Improve apache virtual host configuration #50

Closed
wants to merge 2 commits into
from
View
@@ -8,12 +8,22 @@
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
+ ProxyPass /uploads !
@adaugherity
adaugherity Mar 4, 2013

I also added ProxyPass /error ! after this line to fix the display of HTTP errors coming from apache. Without this, apache tries to load its error page from e.g. /error/HTTP_BAD_GATEWAY.html.var but that gets proxied to unicorn, which then shows a 404 instead of the actual error.

+ ProxyPass /error !
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ProxyPreserveHost On
CustomLog /var/log/apache2/gitlab/access.log combined
ErrorLog /var/log/apache2/gitlab/error.log
+
+ # Modify path to your need (needed for downloading attachments)
+ DocumentRoot /home/git/gitlab/public
+
+ <Location />
+ Order allow,deny
+ Allow from all
+ </Location>
</VirtualHost>
<VirtualHost *:443>
ServerName gitlab.example.com
@@ -24,10 +34,20 @@
SSLCertificateKeyFile /etc/apache2/ssl/server.key
#SSLCertificateChainFile /etc/apache2/ssl/cacert.pem
+ ProxyPass /uploads !
+ ProxyPass /error !
ProxyPass / http://127.0.0.1:3000/
ProxyPassReverse / http://127.0.0.1:3000/
ProxyPreserveHost On
CustomLog /var/log/apache2/gitlab/access.log combined
ErrorLog /var/log/apache2/gitlab/error.log
+
+ # Modify path to your need (needed for downloading attachments)
+ DocumentRoot /home/git/gitlab/public
+
+ <Location />
+ Order allow,deny
+ Allow from all
+ </Location>
</VirtualHost>