添加一个@router的location,在/中添加try_files即可。

 server {
        listen       8013;
        server_name  xxx.com;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

         location / {
              root /www/wwwroot/xxx.com;
              #重点配置
              try_files $uri $uri/ @router;
              index  index.html index.htm;
          }
          #重点配置
          location @router {
              rewrite ^.*$ /index.html last;
          }
    }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2021-06-02
  • 2022-01-31
  • 2021-09-12
  • 2022-12-23
  • 2023-03-10
  • 2022-12-23
相关资源
相似解决方案