server {
listen 8081;
listen [::]:8081;
server_name localhost;
client_max_body_size 100m;
#access_log /var/log/nginx/host.access.log main;
location /stage-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://172.17.0.1:9080/; //后端节点
}
location / {
root /usr/share/nginx/html/dist; //前端映射位置
index index.html index.htm;
try_files $uri $uri/ /index.html; //页面刷新
}