salsa: update apache config
authorPeter Palfrader <peter@palfrader.org>
Thu, 7 Sep 2017 16:30:45 +0000 (18:30 +0200)
committerPeter Palfrader <peter@palfrader.org>
Thu, 7 Sep 2017 16:30:45 +0000 (18:30 +0200)
Tune proxypass, shortcut static files, add a few headers,
and set up error documents,

modules/salsa/templates/apache-salsa.debian.org.conf.erb

index d6e9a96..a417e8e 100644 (file)
@@ -11,8 +11,27 @@ Use common-debian-service-https-redirect * salsa.debian.org
        ErrorLog /var/log/apache2/salsa.debian.org-error.log
        CustomLog /var/log/apache2/salsa.debian.org-access.log privacy
 
-       ProxyPass / http://127.0.0.1:8080/ retry=15
-       ProxyPassReverse / http://127.0.0.1:8080/
+       DocumentRoot /srv/salsa.debian.org/gitlab/public
+
+       ProxyPreserveHost On
+       AllowEncodedSlashes NoDecode
+
+       ProxyPassReverse http://127.0.0.1:8080/
+       ProxyPassReverse http://salsa.debian.org/
+
+       RewriteEngine on
+       RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
+       RewriteCond %{REQUEST_URI} ^/uploads/.*
+       RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA,NE]
+
+       RequestHeader set X_FORWARDED_PROTO 'https'
+       RequestHeader set X-Forwarded-Ssl on
+
+       ErrorDocument 404 /404.html
+       ErrorDocument 422 /422.html
+       ErrorDocument 500 /500.html
+       ErrorDocument 502 /502.html
+       ErrorDocument 503 /503.html
 </VirtualHost>
 
 # vim:set syn=apache: