方法一

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;   }

 

}

相关文章:

  • 2021-10-13
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-09-12
  • 2021-11-23
猜你喜欢
  • 2021-10-02
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案