VUE 项目 nginx部署
server {listen 80; # 监听的端口号server_name 129.204.189.149; # 服务器的ip或者域名#charset koi8-r;#access_log logs/host.access.log main;# 前端服务反向代理配置location / {proxy_http_version 1.1;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;root /root/baker/vue-recruit/dist; # dist目录在服务器的完整路径index index.html index.htm;}# 后端服务反向代理配置location /api {proxy_http_version 1.1;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://129.204.189.149:5000/; # 后端服务所部署的服务器地址以及端口号}
}
Nginx反向代理部署前端Vue项目_can_chen的博客-CSDN博客