小编ane*_*bie的帖子

如何解决nginx反向代理混合内容(http、https)

nginx 的新手。玩了2天,不知道如何解决这个问题:

我有一堆虚拟机在一个盒子里运行,这个盒子显然在我的路由器后面,其中一个虚拟机正在运行 nginx(我的反向代理)并设置为 DMZ。

我已经在该 VM 上正确安装了 SSL 证书,现在我希望所有传入流量都根据其路径进行定向,例如:

domain.com/service1->192.168.1.101

domain.com/service2->192.168.1.102

等等。想法是让 nginx 作为 SSL 层工作,而 nginx 通过 HTTP 或任何未加密的协议与其他 VM 对话。然后当然当 nginx 与客户端对话时,消息应该被加密。

我已经部分工作了。如果我通过 HTTP 访问,除了未加密之外,一切都很好,但是如果我通过 HTTPS 访问,则网页会损坏,并且出现此类错误:Mixed Content: The page at 'https://domain.com/service1' was loaded over HTTPS, but requested an insecure stylesheet 'http://domain.com/service1/blahblah.css'. This request has been blocked; the content must be served over HTTPS.

我也收到了这样的警告: The page at 'https://domain.com/service1/' was loaded over HTTPS, but is submitting data to an insecure location at 'http://domain.com/service1/': this content should …

nginx reverse-proxy

11
推荐指数
4
解决办法
6万
查看次数

标签 统计

nginx ×1

reverse-proxy ×1