Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

installing in subfolder (nginx)


i am trying to install this script step-by-step but have problem.

  1. Need to install into subdirectory,
  2. I get the last version, unzip it in folder
  3. Create rules, like in example:
  4. open URL
  5. and it redirects me to root
  6. trying to change url to and get page without graphics (wrong pathes)

... <link rel="stylesheet" type="text/css" href="/applications/dashboard/design/setup.css?v=2.2.1" media="all" /> <link rel="canonical" href="" /> ...etc

when i trying enter from subdomain, like it works good.

What i am doing wrong? Thanks.


  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP


    Welcome to the community.

    The issue is, I believe, that pretty (nice) urls are not enabled in your nginx conf file.

    Have a look at this thread to see if it helps:

    or this site:

  • i used rules from official site - point 3.

    Trying to create config.php with
    $Configuration['Garden']['RewriteUrls'] = true;
    now it redirects to

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP


    That isn't enough.

    You will need to edit your nginx config file.

    I have a site in a subdomain on nginx, and I followed the conf set up in the post I gave you, and my site works.

    If you don't edit your nginx conf file I don't think you will resole your issue.

  • @whu606 said:
    I have a site in a subdomain on nginx, and I followed the conf set up in the post I gave you, and my site works.

    nginx config edited and reloaded.
    But i talking about subfolder, not subdomain.

  • hmm, tested on other server. Now works.
    Very strange

  • Found problem by myself.

    I have special nginx config with non-standard path_info
    then php_self contains wrong data.

    Now add $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME']; in conf/config.php
    It works.

  • ShadowdareShadowdare r_j MVP
    edited July 2016

    Many nginx guides will state that in order for many other PHP scripts to get the correct the PATH_INFO variable, your PHP-FPM config should have this setting cgi.fix_pathinfo = 0 so that the scripts can rewrite URLs. On the other hand, I believe that Vanilla can handle routes regardless of how cgi.fix_pathinfo is set with the following nginx server config since I just tried toggling this setting and Vanilla URLs worked fine in either case, but this is not a definite answer on if setting it to that is required or not.

    Some history behind this setting is that earlier versions of PHP didn't exactly support PATH_INFO as its own variable and basically combined that information into the SCRIPT_FILENAME variable. With the default setting of cgi.fix_pathinfo = 1, newer PHP applications, including the upcoming Vanilla 2.3 release, can support the proper usage of PATH_INFO as its own variable.

    Here are some basic examples of nginx location blocks you can use with the rewrites from the Vanilla Forums Documentation in your nginx server blocks.

    The fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; line should fix the main issue with PATH_INFO.

    location / {
        try_files $uri @vanilla;
    location @vanilla {
        rewrite ^ /index.php?p=$uri&$args last;
    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_index index.php;
        include fastcgi_params;

    If your Vanilla is installed in a subfolder, you should replace the two main location blocks with this (replacing subfolder with the correct name):

    location /subfolder {
        try_files $uri @vanilla;
    location @vanilla {
        rewrite ^/subfolder(/.*) /subfolder/index.php?p=$1&$args last;

    For scripts that work with cgi.fix_pathinfo = 1, you could replace that PHP location block with the following, which currently doesn't work with Vanilla 2.2 and earlier.

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        fastcgi_index index.php;
        include fastcgi_params;

    Read this page on the nginx wiki and the notes below it for more info, including an explanation for the necessity of handling 404 for security reasons.

    Other good informational resources with examples is the nginx page on the WordPress Codex and this Server Fault post.

    Add Pages to Vanilla with the Basic Pages app

Sign In or Register to comment.