• gerrit 配置 apache2 反向代理(转载)


    Apache 2 Configuration

    To run Gerrit behind an Apache server using mod_proxy, enable the necessary Apache2 modules:

      a2enmod proxy_http
      a2enmod ssl          ; # optional, needed for HTTPS / SSL

    Configure an Apache VirtualHost to proxy to the Gerrit daemon, setting the ProxyPass line to use the http:// URL configured above. Ensure the path of ProxyPass and httpd.listenUrl match, or links will redirect to incorrect locations.

            <VirtualHost *>
              ServerName review.example.com
    
              ProxyRequests Off
              ProxyVia Off
              ProxyPreserveHost On
    
              <Proxy *>
                Order deny,allow
                Allow from all
              </Proxy>
    
              AllowEncodedSlashes On
              ProxyPass /r/ http://127.0.0.1:8081/r/ nocanon
            </VirtualHost>

    The two options AllowEncodedSlashes On and ProxyPass .. nocanon are required since Gerrit 2.6.

    SSL

    To enable Apache to perform the SSL processing, use proxy-https:// in httpd.listenUrl within Gerrit’s configuration file, and enable the SSL engine in the Apache VirtualHost block:

            <VirtualHost *:443>
              SSLEngine on
              SSLCertificateFile    conf/server.crt
              SSLCertificateKeyFile conf/server.key
    
              ... same as above ...
            </VirtualHost>

    See the Apache mod_ssl documentation for more details on how to configure SSL within the server, like controlling how strong of an encryption algorithm is required.

    Troubleshooting

    If you are encountering Page Not Found errors when opening the change screen, your Apache proxy is very likely decoding the passed URL. Make sure to either useAllowEncodedSlashes On together with ProxyPass .. nodecode or alternatively a mod_rewrite configuration with AllowEncodedSlashes NoDecode set.

    From:http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/config-reverseproxy.html

  • 相关阅读:
    什么是 Spring Boot?
    Spring Cloud Gateway?
    什么是 Netflix Feign?它的优点是什么?
    SpringBoot和SpringCloud的区别?
    什么是Hystrix?
    什么是Spring Cloud Bus?
    什么是Ribbon?
    eureka自我保护机制是什么?
    spring cloud 和dubbo区别?
    如何在 Spring Boot 中禁用 Actuator 端点安全性?
  • 原文地址:https://www.cnblogs.com/xiaoerlang/p/3594470.html
Copyright © 2020-2023  润新知