2021年4月27日 06:31 by wst
服务部署之前文件已经描述了怎么用docker部署django和vue:
2. Docker部署Vue
为了在同一域名下部署前后端,这里在nginx上做了串联:
注:前端暴露的端口为17401,后端暴露的端口为17411
upstream business-front{
server 178.20.112.172:17401;
fair;
}
upstream business-backend{
server 178.20.112.172:17411;
fair;
}
server {
listen 80;
server_name admin.xxx.com.cn;
access_log /data/logs/admin.xxx.com.cn.access.log;
error_log /data/logs/admin.xxx.com.cn.error.log;
root /data/business_management_system;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://business-front/;
}
location /api/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://business-backend/;
}
}