【问题标题】:Apache rewrite or susbstitute rule for bugzilla HTTP 301 redirectbugzilla HTTP 301 重定向的 Apache 重写或替代规则
【发布时间】:2018-07-11 20:54:34
【问题描述】:

我正在尝试使用 Apache 2.4 反向代理 bugzilla 4.2.3 站点。

Bugzilla 在 HTTP 上,我无权访问配置。

这是我的 Apache 配置:

<VirtualHost bug.mydomain.com:443>
        SSLEngine on
        SSLCertificateFile /etc/pki/tls/certs/mydomain.crt
        SSLCertificateKeyFile /etc/pki/tls/private/mydomain.key
        ServerAdmin sysadmin@mydomain.com
        ServerName bug.mydomain.com

        RequestHeader unset Accept-Encoding
        ProxyPass "/" "http://192.168.x.x/bugzilla/"
        ProxyPassReverse "/" "http://192.168.x.x/bugzilla/"
        AddOutputFilterByType SUBSTITUTE text/html
        Substitute "s|http://192.168.x.x/bugzilla/|https://bug.mydomain.com/|i"
</VirtualHost>

href 已被 Apache 成功更新,但 bugzilla 在内部使用 HTTP 30x 重定向,而这些并没有被我的规则取代。

这是我的要求:

获取https://bug.mydomain.com/buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=[...]

这是回复:

HTTP 302 http://bug.mydomain.com/bugzilla/buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=[...]

是否也可以重写这些重定向?

【问题讨论】:

    标签: apache reverse-proxy bugzilla


    【解决方案1】:

    我发现的唯一解决方法是添加 HTTP 虚拟主机:

    <VirtualHost bug.mydomain.com:80>
            ServerAdmin sysadmin@mydomain.com
            Redirect permanent /bugzilla/ https://bug.mydomain.com/
            ServerName bug.mydomain.com
    </VirtualHost>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多