mirror of
https://github.com/jlengrand/gitlab-recipes.git
synced 2026-03-10 08:11:17 +00:00
Beware that adding `ProxyPass /uploads !` would be a security issue, since uploads are publicly available without any authentification by default. See: https://github.com/gitlabhq/gitlabhq/issues/348#issuecomment-21682402
60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
# Requires apache modules: mod_proxy and mod_proxy_http
|
|
# In Debian based distros enable with: sudo a2enmod mod_proxy mod_proxy_http
|
|
# Change ServerName to your fqdn
|
|
|
|
<VirtualHost *:80>
|
|
ServerName gitlab.example.com
|
|
#ServerAlias git.example.com
|
|
|
|
# Uncomment the following 3 lines if you want to redirect HTTP to HTTPS
|
|
|
|
#RewriteEngine on
|
|
#RewriteCond %{SERVER_PORT} ^80$
|
|
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
|
|
|
|
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 needs (needed for downloading attachments)
|
|
DocumentRoot /home/git/gitlab/public
|
|
|
|
<Location />
|
|
Order allow,deny
|
|
Allow from all
|
|
</Location>
|
|
|
|
</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
|
|
|
|
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 needs (needed for downloading attachments)
|
|
DocumentRoot /home/git/gitlab/public
|
|
|
|
<Location />
|
|
Order allow,deny
|
|
Allow from all
|
|
</Location>
|
|
|
|
</VirtualHost>
|