由于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; } }
时间: 2025-01-18 09:27:17