I'm trying to install Vanilla 2 on Nginx but am facing 404 Page not found error. After some searching I figured it is url rewrite error. So, tried to translate Apache's rewrite rule:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
as:
if (!-e $request_filename
{
rewrite ^(.*)$ index.php?q=$1 last;
}
But obviously I'm doing something wrong.
Can you help me, please.
Comments
/forum/index.php/garden/gardensetup
How do I get rid of /index.php/ on everything?
$Configuration['Garden']['RewriteUrls'] = TRUE;Thanks, people!
$_SERVER['PATH_INFO'] = preg_replace('|^/forum|','', $_SERVER['REQUEST_URI']);
/forum being my root. In nginx, all I have is:
location /forum/ {
try_files $uri /forum/$uri/ /forum/index.php?$uri;
}
Seems to work fine: http://www.checkfront.com/forum/
Cheers,
-J
I must be a total newbie at this. But Im getting the same error "No Input file Specified"
- I cant find the config.php file. There seems to not be a config.php file in Vanilla 2 RC1. But I do see a config-default.php in the config folder.
2. I do not know if all these fixes listed above applies to me since I have godaddy deluxe hosting which is linux. Anyone know where kind this is?
3. Ive actually cmodded my whole directories and subfolders/files with 777. Yes I know this is very insecure, but I wanted to see if this would solve the problem and thats a Negative.
Id really appreciate some help for the php not inclined person. Id like a step by step guide on how to do this just like a little child if possible.
Thanks for all you do!
However, When i point my browser to the install folder, in this case "Forum", I get the error "No input File Specified"
Further details is, I point it to the folder like this: http://forum.xxxxxxxx.com/forum
and I get this: www.forum.xxxxxxx.com/forum/index.php/dashboard/setup
Again any help would be appreciated.
-Tim
Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
location /forums {
try_files $uri $uri/ /forums/index.php?$uri;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
fastcgi_intercept_errors on;
}
path info is empty
if I add: fastcgi_param PATH_INFO $request_uri;
then path info is /forums/post/discussion
every page is the index page
I'm using this url in the browser to test each change, until I see something that looks right. domain.com/forums/post/discussion
_SERVER["QUERY_STRING"] no value
_SERVER["SCRIPT_NAME"] /forums/post/discussion
_SERVER["SCRIPT_FILENAME"] /var/www/domain.com/forums/index.php
_SERVER["REQUEST_URI"] /forums/post/discussion
_SERVER["DOCUMENT_URI"] /forums/post/discussion
_SERVER["DOCUMENT_ROOT"] /var/www/domain.com
_SERVER["PATH_INFO"] no value
_SERVER["PATH_TRANSLATED"] /var/www/domain.com
_SERVER["PHP_SELF"] /forums/post/discussion
If I visit /forums/post/discussion in the browser, I'm currently seeing the default front page, but the paths to the css, js, etc.. are all incorrect and looking for the paths to these files from the document root instead of from /forums where my install is.
I hope this helps a bit more in diagnosing my issue.
location /forums {
if (!-e $request_filename) {
rewrite ^/forums(.+)$ /forums/index.php?p=$1 last;
}
}
The server variables are:
script_filename => /var/www/domain.com/forums/index.php
script_name => /forums/index.php
query_string => p=/post/discussion
request_uri => /forums/post/discussion
path_info =>
path_translated => /var/www/domain.com
php_self => /forums/index.php
Previously with /index.php?p=$uri; one could not get http://domain.tld/search?Search=abc to work due to args not being proxied.
location / {For forums which are in non-root directories, the following should work:try_files $uri $uri/ /index.php?p=$uri&$args;
}
location /forum/ {Also, don't be an idiot like myself and settry_files /forum$uri /forum$uri/ /forum/index.php?p=$uri&$args;
}
$Configuration['Garden']['RewriteUrls'] = TRUE;in conf/config.php instead of wondering why pretty urls aren't working!
location /forum {try_files $uri $uri/ @forum;}It's better not to use if statements ( http://wiki.nginx.org/IfIsEvil ), and the @ syntax provides for named locations, which is useful for having systems not in the root path, etc. Short and sweet.location @forum {rewrite ^/forum(.+)$ /forum/index.php?p=$1 last;}
[Penny Arcade] Todd commented on your bookmarked discussion.
Todd commented on your bookmarked discussion.
[Vanilla on Nginx]
Test @"Soviet Simplex"
---
Follow the link below to check it out:
http://vanilla.local/discussion/comment/140660#Comment_140660
He surely made a copy of the production database, then doing local test.
Vanilla co-founder
It's not true. Doesn't work at all.
Links Logout, SignIn, all social connects are broken with 403 Forbidden.
Please give somebody really working NGINX rewrites for lasted version of Vanilla!!!
@neolo: Did you do that ?:
As this very forum (vf.org) is ran off nginx, it does work for sure :)
Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
@Neolo
Vanilla Forums Senior Developer [GitHub, Twitter, About.me]
Thanks but this piece of config is not working for me:
location @site { rewrite ^ /index.php?p=$uri&$args last; }
I'm using embedded vanilla on lasted nginx+php-fpm. And seems to be I forced it to work fine with:
location /discuss { index index.php; try_files $uri $uri/ @forum; } location @forum { rewrite ^/discuss(.+)$ /discuss/index.php?p=$1 last; }
Just last time I tried to use this code, I forgot to define an index page.
Thank you.