Apache ProxyPass 本地 NAT 设备

Apache ProxyPass 本地 NAT 设备

尝试使用 ProxyPass 将一些 web-ui 用于本地 NAT 上的设备,但下面的配置无法正常工作。

chrome 控制台日志;

/ddwrt/common.js:-1 Resource interpreted as Script but transferred with MIME type text/html.
/ddwrt/style/elegant/style.css:-1 Resource interpreted as Stylesheet but transferred with MIME type text/html.
/ddwrt/lang_pack/english.js:-1 Resource interpreted as Script but transferred with MIME type text/html.
/ddwrt/images/paypal.gif:-1 Resource interpreted as Image but transferred with MIME type text/html.
/ddwrt/images/88_en_interpayments.png:-1 Resource interpreted as Image but transferred with MIME
/ddwrt/:563 Uncaught ReferenceError: share is not defined
/ddwrt/:566 Uncaught ReferenceError: share is not defined
/ddwrt/:570 Uncaught ReferenceError: share is not defined
style.css Failed to load resource: the server responded with a status of 502 (Proxy Error)
english.js Failed to load resource: the server responded with a status of 502 (Proxy Error)

在 /etc/apache2/sites-available/站点;

    ProxyRequests Off

    <Proxy *>
            Order deny,allow
            Allow from all

            Options FollowSymLinks
            AllowOverride None

            AddDefaultCharset off

            AuthType Basic
            AuthName "Password Required"
            AuthUserFile /usr/local/apache/passwords
            Require valid-user
    </Proxy>

    #RewriteEngine On

    <Location /ddwrt/>
            ProxyPass http://192.168.1.3
            ProxyPassReverse http://192.168.1.3
            RequestHeader unset referer

            #SetOutputFilter proxy-html

            ProxyHTMLURLMap http://192.168.1.3/ /
            #ProxyHTMLURLMap / /ddwrt/
    </Location>

答案1

您是否尝试过注释掉 ProxyHTMLUrlMap 语句?

仅当代理 HTML 代码包含绝对链接时才需要它(http://主机名/foo)。即使没有它,相对链接 (/foo) 也应该可以正常工作。

相关内容