Files
gitlab-recipes/apache/gitlab
Geoff Davis 0a9afffbff Add https only request header option
Adds optional RequestHeader X-Forwarded-Proto "https" for SSL only vhosts to prevent redirects to http:// urls
2013-02-22 10:06:37 +01:00

37 lines
1.1 KiB
Plaintext

# require apache module mod_proxy and mod_proxy_http
<VirtualHost *:80>
ServerName gitlab.example.com
#ServerAlias git.example.com
# Uncomment if you want redirect from HTTP to HTTPS
#RewriteEngine on
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
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
</VirtualHost>
<VirtualHost *:443>
ServerName gitlab.example.com
ServerAdmin gitlab@example.com
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
#SSLCertificateChainFile /etc/apache2/ssl/cacert.pem
# Uncomment the following line to prevent redirects to http on https only vhosts
#RequestHeader set X-Forwarded-Proto "https"
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
</VirtualHost>