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)
gimcnuk
New
Hello.
i am trying to install this script step-by-step but have problem.
- Need to install into subdirectory, http://domain.com/vanilla/
- I get the last version vanilla-core-2-2-1.zip, unzip it in folder
- Create rules, like in example: http://docs.vanillaforums.com/developer/backend/
- open URL http://domain.com/vanilla/
- and it redirects me to root http://domain.com/index.php?p=/dashboard/setup
- trying to change url to http://domain.com/vanilla/index.php?p=/dashboard/setup 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="http://domain.com/index.php?p=/setup" /> ...etc
when i trying enter from subdomain, like http://vanilla.domain.com/ it works good.
What i am doing wrong? Thanks.
Tagged:
0
Answers
@gimcnuk
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:
https://vanillaforums.org/discussion/30390/cant-access-categories-nginx-nice-urls
or this site:
http://www.geektalks.org/vanilla-forum-simple-way-to-get-friendly-urlurls-rewriting-work-in-nginx/
i used rules from official site - point 3.
Trying to create config.php with
$Configuration['Garden']['RewriteUrls'] = true;
now it redirects to http://domain.com/dashboard/setup
@gimcnuk
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.
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.phpIt works.
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 settingcgi.fix_pathinfo = 0
so that the scripts can rewrite URLs. On the other hand, I believe that Vanilla can handle routes regardless of howcgi.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 theSCRIPT_FILENAME
variable. With the default setting ofcgi.fix_pathinfo = 1
, newer PHP applications, including the upcoming Vanilla 2.3 release, can support the proper usage ofPATH_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 withPATH_INFO
.If your Vanilla is installed in a subfolder, you should replace the two main location blocks with this (replacing
subfolder
with the correct name):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.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