nginx 配置
上代码
// listen 端口
// root 项目所在地址
// proxy_pass 服务器地址
// proxy_cookie_path 根据前端配置
server {
listen 8091;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root D:/nginx-1.16.1/manager/dist/;
index index.html index.htm;
}
location /api/ {
proxy_pass http://10.2.1.246:8443/;
proxy_cookie_path /api/ /;
proxy_set_header Cookie $http_cookie;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded $proxy_add_x_forwarded_for;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}