You are not logged in.
Hello everyone.
I just set my nginx server, with php-cgi, as it is in the wiki site and it is working perfectly. I have just one problem. I am trying to rewrite my url, and I got an error after several refreshes.
This is my site configuration.
server {
listen 80;
server_name localhost testwebsite testwebsite.homelinux.org;
access_log logs/testwebsite.access.log main;
location / {
root /home/www/testwebsite;
index index.php;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?path=$1 last;
#rewrite ^/((.*)[^/])$ /index.php?path=$1 last;
}
location ~ \.php$ {
#root www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/testwebsite/$fastcgi_script_name;
include fastcgi_params;
}
}
When I am not trying to rewrite the url, everything is ok, but when I try to rewrite it, after several refreshes on the page, I got nginx error: 502 bad gateway, and the cgi deamon stops to work.
When I restart the fastcgi (I am using the example /etc/rc.d/fastcgi file as it is in the wiki) the web site is working again for several refreshes, and then the fastcgi stops again and I got the bad gateway again.
Can someone tell me what is wrong with my rewrite rule, please.
Regards.
Last edited by Gruntz (2010-04-08 15:58:50)
Offline
I fixed it with that rewrite:
rewrite ^([^.]*)$ /index.php?path=$1;
Offline