nginx 开启https时反向代理http服务的问题

nginx 开启https时反向代理http服务的问题

当我们用nginx开启https时,反向代理一个本地的http服务,会遭遇跨域问题,报错strict-origin-when-cross-origin,导致很多资源无法加载。

这时只要在反向代理部分的配置文件中加入这一条语句即可:

proxy_set_header X-Forwarded-Proto https;

猜你喜欢

转载自blog.csdn.net/qq_51173321/article/details/128894720