【问题标题】:Why is the page blank?为什么页面是空白的?
【发布时间】:2018-03-12 13:44:23
【问题描述】:

我的 Tomcat 正在 Windows server 2012R2 上运行,并且我已经使用以下 URL 配置了一个应用程序 http://localhost:8080/app 我希望将此应用程序上线,以便设置 SSL 反向代理

我正在使用 Apache HTTPS 服务器作为使用 mod_proxy 扩展的反向代理。

ProxyPreserveHost On
ProxyPass /app http://192.168.40.20:8080/app
ProxyPassReverse /app http://192.168.40.20:8080/app

我需要配置 Apache 以将请求传输到 tomcat,如下所示:

https://192.168.40.20/app/ >> http://192.168.40.29:8080/app/

但是当我尝试访问该页面时,我得到一个空白页面,没有显示任何内容

当我检查页面元素时:

Loading failed for the <script> with source “https://192.168.6.136/lib/ueditorsrc/ueditor.config.js”.
insurance:16
Loading failed for the <script> with source “https://192.168.6.136/lib/ueditorsrc/ueditor.all.js”.
insurance:17
Loading failed for the <script> with source “https://192.168.6.136/lib/ionic/js/ionic.bundle.min.js”.
insurance:20
Loading failed for the <script> with source “https://192.168.6.136/lib/ueditorsrc/angular-ueditor.js”.
insurance:21
Loading failed for the <script> with source “https://192.168.6.136/js/app.js”.

页面截图

【问题讨论】:

  • 代理不会更改您的代码,.. 请求要求 /lib/ueditorsrc/ueditor.config.js 而不是 /app/lib/ueditorsrc/ueditor.config.js 您需要更改 HTML / javascript 以引用 /app/lib* 或使所有 URL相对.. 'lib/*` 而不是 /lib/*

标签: javascript tomcat reverse-proxy centos7 mod-proxy


【解决方案1】:

找到了解决方案,它与我在 ap/ 前面放置的正斜杠有关

【讨论】: