I have the following server block:
server {
listen 80;
server_name petpal.co.il;
root /usr/share/nginx/petpal;
index index.php;
location / {
try_files $uri $uri/ @extensionless-php;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ \.php$ {
try_files $uri /notfound;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
What changes do I need to make in order for the 404 document to be displayed in accordance with the directory in which the user is located, for example, in the directory "/ en" will display "/ en / notfound" and in the directory "/" will display / notfound "?
source
share