【问题标题】:Apache reverse proxy with subfolder带有子文件夹的 Apache 反向代理
【发布时间】:2016-02-04 17:11:08
【问题描述】:

我有一个我无法解决的问题。 我这样写我的 apache 配置:

<IfModule mod_ssl.c>
  <VirtualHost *:443>

    ServerAdmin aa@aa.com
    ServerName xx.xx.xx.com

    DocumentRoot /var/www/html

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

    SSLEngine on

    SSLCertificateFile /etc/ssl/localcerts/apache.pem
    SSLCertificateKeyFile /etc/ssl/localcerts/apache.key

    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off

    SSLProxyEngine on

    ProxyPass /bdn/ https://test.yy.it/
    ProxyPassReverse /bdn/ https://test.yy.it/

    RequestHeader unset Accept-Encoding

    Substitute "s|https://test.yy.it/|https://xx.xx.xx.com/bdn/|n"
    FilterDeclare NEWPATHS
    FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/html|"
    FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/css|"
    FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^text/javascript|"
    FilterProvider NEWPATHS SUBSTITUTE "%{Content_Type} =~ m|^application/javascript|"
    FilterChain NEWPATHS

  </VirtualHost>
</IfModule>

反向代理有效,但我丢失了 CSS、javascript、图像、... 为什么??? 我在网上阅读了一些解决方案:

但它们都没有工作。 我正在使用:

  • S.O. Debian 8
  • Apache v. 2.4.10

请帮帮我! 非常感谢。

【问题讨论】:

    标签: apache proxy debian


    【解决方案1】:

    您是否尝试过本教程: http://www.apachetutor.org/admin/reverseproxies ??

    我前段时间用过,一切都很好!

    【讨论】:

    • 我试过了...ProxyRequests off ProxyPass /app1/ https://xx.xx.com/ ProxyHTMLURLMap http://xx.xx.com /app1 &lt;Location /app1/&gt; ProxyPassReverse / ProxyHTMLEnable On ProxyHTMLURLMap / /app1/ RequestHeader unset Accept-Encoding &lt;/Location&gt; 还是不行
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 2017-03-08
    • 2019-02-21
    • 2018-02-14
    • 2020-10-01
    相关资源
    最近更新 更多