我尝试在foo
给出参数后将重定向返回到 index.html cloudshareimage/foo
,而不是 404....with foo
removed。或者任何其他参数。
知道为什么这在 nginx 上不起作用吗?
server {
listen 80;
server_name www.cloudshareimage.com cloudshareimage.com;
access_log /var/log/nginx/cloudimageshare.log;
client_header_buffer_size 128;
expires -1;
access_log /var/log/nginx/cloudimageshare.log;
root /var/www/cloudshareimage/app/static/;
error_page 404 = @notfound;
location / {
error_page 404 = @notfound;
}
location @notfound {
return 301 /;
}
}
- - [27/Mar/2020:07:54:50 -0500] "GET /foo HTTP/1.1" 404 233 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"