server {
listen 8846;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /dev-api/ {
#把 /dev-api 路径下的请求转发给真正的后端服务器
proxy_pass http://111.229.240.203:8080;
#把host头传过去,后端服务程序将收到your.domain.name, 否则收到的是localhost:8080
proxy_set_header Host $http_host;
rewrite ^.+api/?(.*)$ /ruoyi/$1 break;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}