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

相关推荐
锡兰_CC3 小时前
无缝触达,卓越体验:开启openEuler世界的任意门
服务器·网络·数据库·c++·图像处理·qt·nginx
wuxuanok3 小时前
ThinkPHP ——安装部署与配置
sql·mysql·nginx·php
程序员果子7 小时前
零拷贝:程序性能加速的终极奥秘
linux·运维·nginx·macos·缓存·centos
天生励志1237 小时前
Nginx安装部署
运维·nginx
IT利刃出鞘9 小时前
Nginx--变量的使用
运维·nginx
G_Cloudpipe11 小时前
Nginx 服务器部署
运维·服务器·nginx
全栈工程师修炼指南11 小时前
Nginx | 负载均衡策略:ip_hash / hash 会话保持实践
运维·tcp/ip·nginx·负载均衡·哈希算法
全栈工程师修炼指南1 天前
Nginx | 负载均衡策略:一致性哈希算法实践
运维·算法·nginx·负载均衡·哈希算法
街灯L1 天前
【Ubuntu】安装配置nginx文件版
服务器·nginx·ubuntu
黛琳ghz1 天前
极速云原生:openEuler之Redis与Nginx部署性能实战
redis·nginx·云原生·操作系统·压力测试·openeuler·服务器部署