解决element-ui部署到docket容器服务器请求接口404问题

it2024-12-01  14

Docker nginx镜像配置

docker run -d -p 30001:30001 -p 30002:30002 -p 30003:30003 -p 30004:30004 -p 30005:30005 -v /usr/docker/nginx/conf.d:/etc/nginx/conf.d -v /var/www:/usr/share/nginx/html --name mlfnginx nginx

default.conf配置文件

server{ listen 30001; server_name localhost; location / { root /usr/share/nginx/html/wm/front; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }

反向代理配置

server{ listen 30001; server_name localhost; location / { root /usr/share/nginx/html/wm/front; index index.html index.htm; } location /api { proxy_pass http://192.168.1.51:39010; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } }

前端配置

最新回复(0)