用户访问的域名使用了 https ,但后端不同服务可能会转发到不同的后端服务上,这些服务使用 http 时,在获取使用的协议时就变成了 http 。此时需要添加一个转发header: X-Forwarded-Proto
转发配置示例:
location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_pass http://localhost:1337;
}
Copyright © 1998 - Gworg, Inc. All Rights Reserved. 江苏光网数字认证有限公司版权所有
苏ICP备15058404号 苏公网安备32058202010008号