Closed pupadupa closed 9 years ago
Hi pupadupa, the problem is that the urls depend on .htaccess rules which route all requests for non-existent files through index.php; your typical front controller set up. Unfortunately for you, nginx doesn't work with .htaccess rules.
Try adding the following to your 'location /' config...
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
try_files $uri $uri/ /index.php;
}
or
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
try_files $uri $uri/ /index.php?$args;
}
Let me know how you get on.
ElanMan Thanks!
It worked for me (1st solution). Here are my new nginx conf:
server {
listen 80;
root /Users/pupadupa/Dev/www/quiz/public;
index index.php;
server_name quiz;
error_page 404 = /404.php;
error_page 403 = /404.php;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
try_files $uri $uri/ /index.php;
}
location = /info {
allow 127.0.0.1;
deny all;
rewrite (.*) /.info.php;
}
error_page 404 /404.html;
error_page 403 /403.html;
}
Hi,
I'm using nginx. I create virtual host at http://quiz/ When I load main page everything is ok, but any other page gives me 404.
Here what I have in nginx error log:
"/Users/username/Dev/www/quiz/public" - it's path to quiz public folder
Here is my nginx conf:
Please tell me what is the problem?