链路情况

客户端–》Nginx1(aaa.devops.com)–》Nginx2(bbb.devops.com)–》Nginx3(ccc.devops.com)–》运维管理平台

配置文件(只放了反向代理部分)

Nginx1

location / {
  proxy_pass https://bbb.devops.com;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_connect_timeout 600;
     proxy_send_timeout 600;
     proxy_read_timeout 600;
     send_timeout 600;
 }

Nginx2

location / {
    proxy_pass https://ccc.devops.com;
    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_connect_timeout 600;
    proxy_send_timeout 600;
    proxy_read_timeout 600;
    send_timeout 600;
}

这样通过https://aaa.devops.com就能访问https://ccc.devops.com了