【问题标题】:Apache reserve proxy sends blank pageApache 反向代理发送空白页
【发布时间】:2021-01-18 02:18:39
【问题描述】:

我现在在 Raspberry Pi (Raspbian GNU/Linux 10 (buster)) 上运行 Apache (2.4.38-3+deb10u4)。它可以很好地服务于我的网页。它在端口 443 上运行。

我有一个服务在端口 4443(配置文件中的 /aghome)上运行,当我尝试使用它的保留代理来显示这些东西时,它会显示一个空白页面。但是我用代理显示的其他东西工作正常(配置文件中的 /jsonrpc 和 /dns-query)。

看起来这是一个只有一个 JavaScript 文件的页面。

The source code of the webpage.

并且在控制台中,有一些错误。

The error information in the console.

打开F12开发者工具,可以看到网页的源代码,但是就是不行。

我的 Apache2 配置文件(/etc/apache2/sites-enabled/default-ssl.conf):

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin webmaster@localhost
        ServerName my-domain
        DocumentRoot /mnt/ks/www/html

        Protocols h2 http:/1.1

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        ProxyPreserveHost On
        ProxyVia On
        ProxyRequests Off 
        SSLProxyEngine On

        ProxyPass /dns-query https://localhost:4443/dns-query
        ProxyPassReverse /dns-query https://localhost:4443/dns-query

        ProxyPass /aghome https://localhost:4443/
        ProxyPassReverse /aghome https://localhost:4443/

        ProxyPass /jsonrpc https://localhost:6800/jsonrpc
        ProxyPassReverse /jsonrpc https://localhost:6800/jsonrpc

        SSLEngine on

        SSLCertificateFile  /etc/letsencrypt/live/my-domain/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/my-domain/privkey.pem

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>

        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>

    </VirtualHost>
</IfModule>

我应该怎么做才能解决这个问题?谢谢。

【问题讨论】:

  • 您的“源代码”无法编译。请不要将文字内容作为图像发布。它们无法被索引,并且无法访问。 (用全文编辑您的问题)。另外:控制台消息清楚地说明了缺少的内容。他们是对的吗? (他们是,但你在这方面做了什么?)
  • 我解决了我的问题。不过感谢您的回复。

标签: apache web apache2 apache2.4


【解决方案1】:

问题解决了。 我现在使用 Nginx 而不是 Apache。因此可以加载 JavaScript。我只是想不通为什么 Apache 不能正确地提供这些东西。但是,Nginx 工作正常。

【讨论】:

    猜你喜欢
    • 2010-09-20
    • 2015-02-12
    • 2020-04-04
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多