比如访问 http://localhost:801/index.asp
通过nginx后 http://localhost:801/index.html
location / {
if ( $request_uri ~* \.asp$){ #截取后缀asp的
rewrite ^/(.*)\.asp$ /$1.html last; #后缀为asp的替换成html
break;
}
}
本文介绍了一种使用Nginx将ASP页面请求重定向至HTML页面的方法,通过配置location指令和rewrite规则,实现从ASP到HTML的平滑过渡。
比如访问 http://localhost:801/index.asp
通过nginx后 http://localhost:801/index.html
location / {
if ( $request_uri ~* \.asp$){ #截取后缀asp的
rewrite ^/(.*)\.asp$ /$1.html last; #后缀为asp的替换成html
break;
}
}
2491
1762
1117
7144

被折叠的 条评论
为什么被折叠?