Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <VirtualHost *:80>
- ServerName gitlab.example.com
- ServerAdmin webmaster@example.com
- ServerSignature Off
- RewriteEngine on
- RewriteCond %{HTTPS} !=on
- RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]
- </VirtualHost>
- <VirtualHost *:443>
- SSLEngine on
- #strong encryption ciphers only
- #see ciphers(1) http://www.openssl.org/docs/apps/ciphers.html
- # You might want to only keep TLS
- #SSLCipherSuite SSLv3:TLSv1:+HIGH:!SSLv2:!MD5:!MEDIUM:!LOW:!EXP:!ADH:!eNULL:!aNULL
- # Your own self-signed certificates
- SSLCertificateFile /etc/letsencrypt/live/gitlab.example.com/fullchain.pem
- SSLCertificateKeyFile /etc/letsencrypt/live/gitlab.example.com/privkey.pem
- # SSLCACertificateFile /etc/apache2/certs/your-ca.crt
- ServerName gitlab.example.com
- ServerAdmin webmaster@example.com
- ServerSignature Off
- ProxyPreserveHost On
- # Ensure that encoded slashes are not decoded but left in their encoded state.
- # http://doc.gitlab.com/ce/api/projects.html#get-single-project
- AllowEncodedSlashes NoDecode
- <Location />
- #Order deny,allow
- #Allow from all
- Require all granted
- ProxyPassReverse http://127.0.0.1:8060
- ProxyPassReverse http://gitlab.example.com/
- </Location>
- #apache equivalent of nginx try files
- # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
- # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
- RewriteEngine on
- RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
- RewriteRule .* http://127.0.0.1:8060%{REQUEST_URI} [P,QSA]
- RewriteCond %{REQUEST_URI} ^/uploads/.*
- RequestHeader set X_FORWARDED_PROTO 'https'
- #RequestHeader set X-Forwarded-Ssl on
- # needed for downloading attachments
- DocumentRoot "/opt/gitlab/embedded/service/gitlab-rails/public"
- #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
- ErrorDocument 404 /404.html
- ErrorDocument 422 /422.html
- ErrorDocument 500 /500.html
- ErrorDocument 503 /deploy.html
- LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
- # Path must exists
- ErrorLog /var/log/apache2/com/example/gitlab/gitlab_error.log
- CustomLog /var/log/apache2/com/example/gitlab/gitlab_forwarded.log common_forwarded
- CustomLog /var/log/apache2/com/example/gitlab/gitlab_access.log combined env=!dontlog
- CustomLog /var/log/apache2/com/example/gitlab/gitlab.log combined
- </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement