置顶 nginx 前后端部署配置

技术 后端

Nginx

2020-06-23 11:12:11

246

作者:黑夜男神

server
{
  listen 80;
  server_name www.csde.club 106.55.157.83;
  # 前台blog
  location / {
       proxy_pass http://127.0.0.1:8012 ;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $remote_addr;
  }
  # 后台二级前端路由目录
  location /csde_admin {
    alias html/csde-admin-vue/dist;
    expires 7d; # 缓存浏览器7天
    index index.html;
  }
  # 后端接口地址
  location ~api/ {
    proxy_pass http://localhost:10086;
    proxy_redirect off;
    proxy_set_header Remoteip $http_remoteip;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
  }
  # 静态文件目录
  location ~public/ {
        proxy_pass http://localhost:10086;
    }
    # webhook钩子
  location /webhook {
     proxy_pass http://localhost:7777/webhook;
  }   
}

评论 (0)

用户名
邮箱
评论

    Copyright © 2020 darkNightMan All Rights Reserved Pro 黔ICP备20005477号