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博客

相关推荐
米粉03059 小时前
深入剖析Nginx:从入门到高并发架构实战
java·运维·nginx·架构
静水楼台x12 小时前
nginx日志的一点理解
运维·nginx
欧先生^_^13 小时前
ingress-nginx 开启 Prometheus 监控 + Grafana 查看指标
nginx·grafana·prometheus
眠修14 小时前
Nginx + Tomcat负载均衡群集
nginx·tomcat·负载均衡
瘦皮猴19 小时前
golang context canceled异常排查
后端·nginx
hunter1271 天前
Nginx 事件驱动理解
nginx
fydw_7151 天前
生产环境中安装和配置 Nginx 以部署 Flask 应用的详细指南
运维·nginx·flask
xzh1 天前
问题:Nginx client_body_temp_path 文件会删除吗,删除时机?
nginx·架构
dessler2 天前
代理服务器-LVS的3种模式与调度算法
运维·服务器·网络·算法·nginx·tomcat·lvs
2501_911121232 天前
Nginx+Tomcat 负载均衡群集
nginx·tomcat·负载均衡