我有一个这样的目录结构:
/opt/mysite/www:
F: index.html
D: connect/
F: -- index.html
F: -- page.html
带有 URLhttp://www.mysite.io/connect,try_files 导致 301 错误: http://www.mysite.io:8080/connect/
nginx 为什么要附加监听端口?
server {
listen 8080;
server_name www.mysite.io;
index index.htm index.html /index.htm;
root /opt/mysite/www/;
location / {
try_files $uri $uri.html $uri/index.html =404;
}
}