threeperson
发布于 2019-06-10 / 0 阅读
0
0

nginx 转发其他域名502 403 等问题

由于需要在微信小程序中加载第三方的H5页面,且三方地址不支持https,导致微信小程序无法正常加载页面。

于是乎想到通过nginx转发,但是发现遇到502问题。看来一下nginx转发日志,发现host携带的是代理地址。于是

调整了一下host,问题解决。

###proxy_set_header Host 被代理地址

```

location / {

proxy_set_header Host web.witspring.com;

proxy_set_header X-Forward-For $remote_addr;

proxy_pass http://web.witspring.com/ ;

access_log /home/data/nginx/logs/witspring/access.log main;

}

```


评论