vue 打包
npm run build
修改config
listen 80 ;
server_name localhost;
location / {
root html/dist;
index index.html index.htm;
try_files $uri $uri / /dist/index.html;
}
location /prod-api/ {
proxy_set_header Host $http_host ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header REMOTE-HOST $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_pass http://localhost:8080/;
}
location = /.well-known/pki-validation/ {
default_type "text/plain" ;
root /.well-known/pki-validation/;
index index.html index.htm;
}
error_page 500 502 503 504 404 /dist/index.html;
location = /dist/index.html {
root html;
}