或者npm run build:prod


- server {
- listen 8787;
- server_name localhost;
-
- location / {
- root app/dist; #前端dist包地址
- index index.html index.htm;
- }
- #代理后端接口
- location /demo/{
- add_header Access-Control-Allow-Origin *;
- add_header Access-Control-Allow-Methods "GET,POST,OPTIONS,PUT,DELETE";
- add_header Access-Control-Allow-Headers "Token,DNT,X-Mx-ReqToken,keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization";
- proxy_pass http://192.168.1.33:9999/demo/;
- }
- nginx -s reload # 重新载入配置文件
- nginx -s reopen # 重启 Nginx
- nginx -s stop # 停止 Nginx
- start nginx # 启动 Nginx