Answer the question
In order to leave comments, you need to log in
An error in the nginx config?
The problem is that test.com doesn't find the app.php file and does try_files showing me error.php;
But when I explicitly write test.com/app.php it works!
Can't understand.....
Paths: var/www/test.com /web/ ->
error.php
app.php and etc....
server {
listen 80;
listen [::]:80;
charset utf-8;
server_name test.com www.test.com;
root /var/www/test.com/web;
index index.php app.php;
location ~ /\. {
deny all;
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri /error.php;
index app.php;
}
location ~ \.php$ {
try_files $uri /error.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index app.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
include fastcgi_params;
}
}
Answer the question
In order to leave comments, you need to log in
I think you need something like
location / {
try_files $uri /app.php?$request_uri /error.php;
}
This is how it should work:try_files $uri $uri/ /error.php;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question