nginx如何设置访问跳转到一个固定页面
方法一
server
{
listen 80 ;
server_name www.xxx.com xxx.com;
index test.html index.html index.htm index.php; #直接放置index下
root /path/to/;
}
方法二
server
{
listen 80 ;
server_name www.xxx.com xxx.com;
index index.html index.htm index.php;
root /path/to/;
if ($document_uri !~ 'test.html' ){
rewrite ^/(.*)$ http://www.xxx.com/test.html permanent; }
}