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

相关推荐
七七powerful11 小时前
loki监控docker容器&系统&nginx日志的告警规则
nginx·docker·容器
dovens15 小时前
httpslocalhostindex 配置的nginx,一刷新就报404了
运维·nginx
riNt PTIP17 小时前
Ubuntu 系统下安装 Nginx
数据库·nginx·ubuntu
wellc19 小时前
Nginx作用以及应用场景
运维·nginx
lclcooky19 小时前
Nginx代理到https地址忽略证书验证配置
运维·nginx·https
草木红20 小时前
Vue3 + Docker + Nginx 完整部署流程
nginx·docker·容器
lljss202021 小时前
1. Nginx架构,反向代理和负载均衡
nginx
高木木的博客1 天前
数字架构智能化测试平台(1)--总纲
人工智能·python·nginx·架构
徐子元竟然被占了!!2 天前
Nginx
运维·nginx
图图玩ai2 天前
SSH 命令管理工具怎么选?从命令收藏到批量执行一次讲清
linux·nginx·docker·ai·程序员·ssh·可视化·gmssh·批量命令执行