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

相关推荐
陈皮糖..9 小时前
27 届运维实习笔记|第三、四周:从流程熟练到故障排查,企业运维实战深化
运维·笔记·sql·nginx·ci/cd·云计算·jenkins
空中海16 小时前
Nginx 知识体系 · 下篇:高级与实战
运维·nginx·spring
身如柳絮随风扬21 小时前
Nginx 入门教程:从安装到配置反向代理与负载均衡
运维·nginx·负载均衡
IntMainJhy1 天前
Flutter flutter_animate 第三方库 动画的鸿蒙化适配与实战指南
nginx·flutter·harmonyos
mfxcyh1 天前
使用MobaXterm配置nginx
java·服务器·nginx
阿里巴巴首席技术官1 天前
通过纯Nginx实现一个简单的文件上传功能
运维·nginx
就叫飞六吧1 天前
Docker Hub 上主流的nginx发行
java·nginx·docker
RePeaT2 天前
【Nginx】前端项目部署与反向代理实战指南
前端·nginx
wicb91wJ62 天前
Nginx反向代理与负载均衡配置详解
运维·nginx·负载均衡
蜡台2 天前
centos 8 安装 nginx-1.29.8 及相关配置教程
linux·nginx·centos