现在线上有一个网站正在跑着http://www.test.com,要加一个网址http://www.test.com/temp/访问的的是/workspace/test/temp/Views/Index/temp.html
可以这样配置
server {
listen 80;server_name www.test.com;
location / {
root /workspace/test;
index index.html index.htm;
}
location /temp {
alias /workspace/test/temp;
index Index.html;
try_files $uri @rewriteweb;
}
location @rewriteweb {
rewrite ^/temp/(.*)$ /temp/Views/Index/temp.html last;
}
}