listen 站点端口
server_name 服务名字,通常为服务器地址
root 后面是dist项目地址
proxy_pass 服务端接口代理
server {
listen 6788;
server_name 192.168.1.54;
charset utf-8;
client_max_body_size 75M;
root /opt/netweb/dist;
location / {
try_files $uri $uri/ @router;
index index.html;
autoindex on;
autoindex_exact_size on;
autoindex_localtime on;
}
location @router {
rewrite ^.*$ /index.html last;
}
location /api{
proxy_pass http://xxxxxxxx:8090/api;
}
}
按照这样配不行你找我