bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 166 forks source link

403 Forbidden or 404 Not Found on Nginx #197

Closed yingyi-chow closed 9 years ago

yingyi-chow commented 9 years ago

I have the following configuration in Nginx for genghis:

index index.php index.html index.htm;
server {
    root /var/www/genghis;
    location / {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root/genghis.php;
        fastcgi_param SCRIPT_NAME /genghis.php;
        rewrite /genghis.php / permanent;
    }
}

However, I kept getting 403 Forbidden error or 404 Not Found after trying to tinkle with the configurations.. The permission for genghis.php is set to 644 and it's parent folder is set to 755.

Not sure if I am missing out anything. Thanks.

yingyi-chow commented 9 years ago

I managed to solve it.

Instead of using the default included in snippets/fastcgi-php.conf, I removed that line and added the following lines just after fastcgi_pass line:

include fastcgi_params; fastcgi_param PATH_INFO $uri;

bobthecow commented 9 years ago

Did the version on the wiki work for you?

https://github.com/bobthecow/genghis/wiki#nginx-configuration

yingyi-chow commented 9 years ago

Absolutely. Got to configure it exactly the same for it to work. I only managed to get it to work on a subdomain though. Thanks!