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

相关推荐
PanZonghui6 小时前
Centos项目部署之Nginx 的安装与卸载
linux·nginx
charlee4417 小时前
nginx部署发布Vite项目
nginx·性能优化·https·部署·vite
CRMEB定制开发19 小时前
【实战】CRMEB Pro 企业版安装教程(附 Nginx 反向代理配置 + 常见问题解决)
nginx·商城系统·微信商城·crmeb
孙克旭_2 天前
day045-nginx跳转功能补充与https
linux·运维·nginx·https
博同学2 天前
Nginx + ELK + Grafana 全球访问热力图
nginx·elk·grafana
RW~2 天前
Minio安装配置,桶权限设置,nginx代理 https minio
运维·nginx·https·minio
CodeWithMe2 天前
Nginx入门进阶:从零到高手的实战指南
运维·nginx
Ahlson2 天前
【fnNAS】docker的nginx配置html
nginx·docker·容器·fnnas
斯普信专业组2 天前
K8s环境下基于Nginx WebDAV与TLS/SSL的文件上传下载部署指南
nginx·kubernetes·ssl
亦舒.2 天前
宝塔面板Nginx手动配置负载均衡实战指南
运维·nginx·负载均衡