配置当访问/test_login时,如果url有对应的页面则返回相对应的页面,如果页面不存在则返回index.html文件。
location /test_login {
proxy_connect_timeout 6000s;
proxy_send_timeout 6000s;
proxy_read_timeout 6000s;
root /opt/project;
try_files $uri /index.html; # 始终返回 index.html
}
location = /index.html {
root /opt/project;
index index.html index.htm;
}