Apache 反向代理 由 HTTPS 变为 HTTP 并能够 get 和 post

Eniak 2015-07-19 04:34:23
项目是这样的,有一台LinuxA 上面装有 Apache,有一台LinuxT 上面装有 Tomcat

Apache 是 HTTPS 服务器 作为代理服务器 , 可以被公共访问

Tomcat是 HTTP 服务器,是真生的业务服务器,处于内网,只能被 Apache 访问

Apache 主要就是把来自 阅览器的请求,传递到 Tomcat 上面。


用于测试的 test_backend 可以被成功的代理到 http://www/baidu.com 上面

可以使用实际业务的 not_test_backend,却不能

下面是我的配置


ProxyPass /test_backend http://www.baidu.com
ProxyPassReverse /test_backend http://www.baidu.com

ProxyPass /not_test_backend http://xxx.xx.xx.xx:8080/not_test_backend
ProxyPassReverse /not_test_backend http://xxx.xx.xx.xx:8080/not_test_backend
<Location /not_test_backend/>
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
Header edit Location ^http://xxx.xx.xx.xx:8080/not_test_backend https://myapp.myhostwebsite.net/not_test_backend/



也就是说,如果默认发送一个请求 get 或者 post 到 https://myapp.myhostwebsite.net/not_test_backend/, 那么这个请求就需要自动被倒传递到 http://xxx.xx.xx.xx:8080/chartflow_backend


浏览器是 Google 的 Chrome,得到的回馈是

Mixed Content: The page at 'https://myapp.myhostwebsite.net/not_test_backend/#/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://xxx.xx.xx.xx:8080/not_test_backend/logInOut/logIn?email=XXX@XXX,com&password=123456789'. This request has been blocked; the content must be served over HTTPS.


我试图重写 header ,可是不管用呢

跪求帮帮忙了
...全文
812 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧