diff --git a/nginx-server.conf b/nginx-server.conf index 946c027..5186100 100644 --- a/nginx-server.conf +++ b/nginx-server.conf @@ -5,10 +5,7 @@ server { root /var/www/html/; index index.html index.htm; # 解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 - if (!-e \$request_filename) { - rewrite ^(.*)\$ /index.html?s=\$1 last; - break; - } + try_files $uri $uri/ /index.html; } location /api/ {