Estou começando com o Nginx e tenho muitos problemas, já que as coisas mudam do Apache para o Nginx. Agora eu tenho um aplicativo desenvolvido no Symfony1.4 que não funciona desde que eu recebo um erro 404 Not Found
. Estes são os registros de erro:
2014/02/07 21:28:49 [error] 2091#0: *22 open()
"/var/www/html/apps/monitor/web/index.php/login" failed (20: Not a
directory), client: 192.168.3.1, server: devserver, request: "POST
/apps/monitor/web/index.php/login HTTP/1.1", host: "devserver",
referrer: "http://devserver/apps/monitor/web/" 2014/02/07 21:29:11
[error] 2091#0: *22 open() "/var/www/html/apps/monitor/web/login"
failed (2: No such file or directory), client: 192.168.3.1, server:
devserver, request: "GET /apps/monitor/web/login HTTP/1.1", host:
"devserver"
E este é o conteúdo do meu arquivo /etc/nginx/conf.d/default.conf
:
server {
listen 80;
server_name devserver;
root /var/www/html;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
index index.php;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
O que está errado?
Adicionado try_files
directive
Adicionei try_files
da seguinte forma, mas não corrijo o problema que estou tendo:
try_files $uri $uri/ /index.php?$args;
EDIT2: Tente de outra forma, obtenha 500 erros de servidor
Eu tentei outra alternativa mudando para isso:
índice index.php app.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php/$1;
}
location ~ \.php$ {
fastcgi_index app.php;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Mas os registros disseram isso:
2014/02/07 22:06:11 [error] 2905#0: *2 rewrite or internal redirection cycle while internally redirecting to "/apps/monitor/web/index.php/login", client: 192.168.3.1, server: devserver, request: "GET /apps/monitor/web/index.php/login HTTP/1.1", host: "devserver"
Tags nginx php-fpm web-server