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

gerrit 配置 apache2 反向代理(转载)的更多相关文章

  1. CentOS 7 学习(二) 配置Nginx反向代理

    CentOS 7 学习(二) 配置Nginx反向代理 Nginx可以通过php-fpm来运行PHP程序,也可以转向apache,让apache调用php程序来运行. 不过对于Nginx来说,其反向代理 ...

  2. CentOS安装Nginx,并配置nodejs反向代理

    安装介绍 安装位置:/usr/local/nginx nginx安装包下载地址:http://nginx.org/download/nginx-1.7.11.tar.gz 安装依赖软件 安装nginx ...

  3. 为docker私有registry配置nginx反向代理

    公司的Docker私有registry已经搭建好了,用官方的registry image很容易就搭建好了.现在就是要用nginx的反向代理把它放出来,以便在外网可以访问. 我的上一篇blog 讲了如何 ...

  4. 配置apache反向代理进行跨域

    配置apache反向代理 打开配置文件httpd.conf 开启 proxy_http_module 和 proxy_module 模块,将#号删除 #LoadModule proxy_module ...

  5. 使用SSL配置Nginx反向代理的简单指南

    反向代理是一个服务器,它接收通过Web发出的请求,即http和https,然后将它们发送到后端服务器(或服务器).后端服务器可以是单个或一组应用服务器,如Tomcat,wildfly或Jenkins等 ...

  6. Nginx配置实例-反向代理实例:根据访问的路径跳转到不同端口的服务中

    场景 Ubuntu Server 16.04 LTS上怎样安装下载安装Nginx并启动: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/detai ...

  7. 配置LANMP环境(7)-- 配置nginx反向代理,与配置apache虚拟主机

    一.配置nginx反向代理 1.修改配置文件 vim /etc/nginx/nginx.conf 在35行http下添加一下内容: include /data/nginx/vhosts/*.conf; ...

  8. apache2反向代理node.js应用

    在之前记录的随笔中,只是介绍了怎么在apache2中使用proxy模块,后来查到了一些资料,可以通过下面网址查看配置块的详细参数信息 http://man.ddvip.com/soft/apache2 ...

  9. apache2反向代理

    1.安装 Apache2 sudo apt-get install apache2 2.重启服务器 sudo /etc/init.d/apache2 restart 3.虚拟主机配置 启用这几个模块 ...

随机推荐

  1. 如果将彩色图像和灰度图像一起放进 CNN 中去,会是什么结果?

    如果将彩色图像和灰度图像一起放进 CNN 中去,会是什么结果? 今天,坑爹的实验,我处理 SUN397 的时候,忘记去掉灰度图了,结果,利用微调后的 model 提取 feature,悲剧的发现,无论 ...

  2. [译] AlphaGo 的确是一个大事件

    [译] AlphaGo 的确是一个大事件 转自:http://www.jianshu.com/p/157a15de47df 字数3797 阅读696 评论0 喜欢4 作者:Michael Nielse ...

  3. share point 读取 List数据

    SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite oSite = new SPSite(siteUrl)) { forea ...

  4. MVC View中获取Url参数的值

    如果url是 /home/index?id=3 直接Request就ok. Razor方法 @Html.ViewContext.RouteData.Values["id"] @Re ...

  5. Android 如何全局获取Context

    有时,在处理业务逻辑的时候,需要Context对象,但在某些情况下,并非容易获取,这时就需要一些巧妙的手段来管理Context. 在Android中,提供了一个类Application,当应用程序启动 ...

  6. Sass用法指南_20151109笔记

    写在前面的话:随着CSS文件越来越大,内容越来越复杂,对其进行很好的维护将变的很困难.这时CSS预处理器就能够帮上大忙了,它们往往拥有变量.嵌套.继承等许多CSS不具备的特性.有很多CSS预处理器,这 ...

  7. [mysql] mysql 5.6.27 innodb 相关参数

    mysql> show variables like '%innodb%';+------------------------------------------+--------------- ...

  8. CSS Margin外边距合并

    应该知道这点东西的!!! 可是偏偏记不住! 外边距合并会发生在以下两种情况下: 1 垂直出现的两个拥有外边距的块级元素. div1 { margin-bottom: 20px; } div2 { ma ...

  9. jQuery网页右侧固定层显示隐藏在线qq客服代码

    CSS代码: @charset "utf-8"; ;;} html,body{font-size:12px;font-family:"微软雅黑";outline ...

  10. php 连接测试sphinx

    shpinx.php <?php header("Content-type:text/html;charset=utf-8"); include 'SphinxClient. ...