文章已阅读
 

在配置中添加:

try_files $uri $uri/ /index.html; —解决页面刷新404问题

实例:

 location / {
            add_header 'Access-Control-Allow-Origin' *;
            add_header 'Access-Control-Allow-Methods' 'GET,HEAD,OPTIONS,POST,PUT';  
            add_header 'Access-Control-Allow-Headers' 'DNT, X-Mx-ReqToken, Keep-Alive, User-Agent, X-Requested-With';  

            root   html\VueWeb;
            index  index.html index.htm;

            try_files $uri $uri/ /index.html; ---解决页面刷新404问题    

               location /api{          
                rewrite ^/api/(.*)$ /$1 break;
                proxy_pass HTTP://localhost:5000;
               }              
        }
2022-10-13

浏览 |

© 2023 南疆 with help from Hexo and Twitter Bootstrap. Theme by Freemind.

container-narrow -->