summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2013-04-17 07:31:50 -0700
committerShawn Pearce <sop@google.com>2013-04-17 07:31:50 -0700
commit5c8131eb62bead1637f65fbf51a0e5da97d819c2 (patch)
treef1540383212399f0af74165242936c2e8a209a37 /Documentation
parente73a991c593e1b18951b7a419a828166ccb03a80 (diff)
parentdbcfd690f1c0cd9655d05f4e73ce267a6048b55f (diff)
Merge branch 'stable-2.6'
* stable-2.6: Update proxy example shown on container configuration error page Fix sample reverse proxy configuration for Apache Fix display of account name when name consists only of spaces Show filter field on project/group list screen before populating the list
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config-reverseproxy.txt36
1 files changed, 17 insertions, 19 deletions
diff --git a/Documentation/config-reverseproxy.txt b/Documentation/config-reverseproxy.txt
index 67d2004ab9..c932c0c49c 100644
--- a/Documentation/config-reverseproxy.txt
+++ b/Documentation/config-reverseproxy.txt
@@ -28,36 +28,34 @@ during 'init'.
Apache 2 Configuration
----------------------
-To run Gerrit behind an Apache server using 'mod_proxy', enable the
+To run Gerrit behind an Apache server we cannot use 'mod_proxy'
+directly, as Gerrit relies on getting unmodified escaped forward
+slashes. Depending on the setting of 'AllowEncodedSlashes',
+'mod_proxy' would either decode encoded slashes, or encode them once
+again. Hence, we resort to using 'mod_rewrite'. To enable the
necessary Apache2 modules:
----
- a2enmod proxy_http
+ a2enmod rewrite
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.
+Configure an Apache VirtualHost to proxy to the Gerrit daemon, setting
+the 'RewriteRule' line to use the 'http://' URL configured above.
+Ensure the path of 'RewriteRule' (the part before '$1') and
+httpd.listenUrl match, or links will redirect to incorrect locations.
+
+Note that this configuration allows to pass encoded characters to the
+virtual host, which is potentially dangerous. Be sure to read up on
+this topic and that you understand the risks.
----
<VirtualHost *>
ServerName review.example.com
- ProxyRequests Off
- ProxyVia Off
- ProxyPreserveHost On
-
- <Proxy *>
- Order deny,allow
- Allow from all
- </Proxy>
-
- <Location /r/>
- AllowEncodedSlashes NoDecode
- </Location>
- ProxyPass /r/ http://127.0.0.1:8081/r/
+ AllowEncodedSlashes NoDecode
+ RewriteEngine On
+ RewriteRule ^/r/(.*) http://localhost:8081/r/$1
</VirtualHost>
----