Files
gitlab-recipes/web-server/apache/gitlab.conf
2013-08-18 16:09:47 +03:00

67 lines
1.8 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
#
# You need to run openssl to generate a self-signed ssl certificate:
# cd /etc/apache2 (or /etc/httpd)
# sudo openssl req -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
# sudo chmod o-r gitlab.key
<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 !
# If you use puma, see https://github.com/gitlabhq/gitlab-recipes/blob/master/web-server/apache/README.md
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
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/gitlab.crt
SSLCertificateKeyFile /etc/apache2/gitlab.key
ProxyPass /uploads !
ProxyPass /error !
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
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>