码迷,mamicode.com
首页 > 其他好文 > 详细

【Nginx】nginx 代理 Haproxy 怎么设置?

时间:2016-11-28 19:49:53      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:cloud   png   blog   location   pst   server   技术分享   配置   cat   

 

由于Haproxy是通过 url 正则匹配 识别 的,nginx代理到 haproxy需要设置 

proxy_set_header Host 为 haproxy的目标 url

直接上配置

upstream rcm01_api_haproxy {
        server nscloud.rcm01.api.nsfocus.com;
}

server {
       listen 80;

       server_name nscloud.api.nsfocus.com;


       location / {
               proxy_pass http://rcm01_api_haproxy;
               proxy_set_header Host nscloud.rcm01.api.nsfocus.com;
       }
}

 

技术分享

 

【Nginx】nginx 代理 Haproxy 怎么设置?

标签:cloud   png   blog   location   pst   server   技术分享   配置   cat   

原文地址:http://www.cnblogs.com/junneyang/p/6110760.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!