404個文件我有以下的服務器塊:化妝nginx的服務相對於當前路徑
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;
}
}
我需要什麼樣的修改,以做,使根據目錄就那麼404文件將會顯示用戶目前處於,例如在「/ en」目錄中,它將顯示「/ en/notfound」,並且在目錄「/」中顯示「/ notfound」?
怎麼會沒有答案?這個問題真的很複雜嗎? –