|
1 | | -# require apache module mod_proxy and mod_proxy_http |
| 1 | +# Requires apache modules: mod_proxy and mod_proxy_http |
| 2 | +# In Debian based distros enable with: sudo a2enmod mod_proxy mod_proxy_http |
| 3 | +# Change ServerName to your fqdn |
| 4 | + |
2 | 5 | <VirtualHost *:80> |
3 | 6 | ServerName gitlab.example.com |
4 | 7 | #ServerAlias git.example.com |
5 | 8 |
|
6 | | - # Uncomment if you want redirect from HTTP to HTTPS |
| 9 | + # Uncomment the following 3 lines if you want to redirect HTTP to HTTPS |
| 10 | + |
7 | 11 | #RewriteEngine on |
8 | 12 | #RewriteCond %{SERVER_PORT} ^80$ |
9 | 13 | #RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R] |
10 | 14 |
|
| 15 | + ProxyPass /uploads ! |
| 16 | + ProxyPass /error ! |
11 | 17 | ProxyPass / http://127.0.0.1:3000/ |
12 | 18 | ProxyPassReverse / http://127.0.0.1:3000/ |
13 | 19 | ProxyPreserveHost On |
14 | 20 |
|
15 | 21 | CustomLog /var/log/apache2/gitlab/access.log combined |
16 | 22 | ErrorLog /var/log/apache2/gitlab/error.log |
| 23 | + |
| 24 | + # Modify path to your needs (needed for downloading attachments) |
| 25 | + DocumentRoot /home/git/gitlab/public |
| 26 | + |
| 27 | + <Location /> |
| 28 | + Order allow,deny |
| 29 | + Allow from all |
| 30 | + </Location> |
| 31 | + |
17 | 32 | </VirtualHost> |
| 33 | + |
18 | 34 | <VirtualHost *:443> |
19 | 35 | ServerName gitlab.example.com |
20 | 36 | ServerAdmin gitlab@example.com |
21 | 37 |
|
22 | 38 | SSLEngine On |
23 | 39 | SSLCertificateFile /etc/apache2/ssl/server.crt |
24 | 40 | SSLCertificateKeyFile /etc/apache2/ssl/server.key |
25 | | - #SSLCertificateChainFile /etc/apache2/ssl/cacert.pem |
26 | | - |
27 | | - # Uncomment the following line to prevent redirects to http on https only vhosts |
28 | | - #RequestHeader set X-Forwarded-Proto "https" |
29 | 41 |
|
| 42 | + ProxyPass /uploads ! |
| 43 | + ProxyPass /error ! |
30 | 44 | ProxyPass / http://127.0.0.1:3000/ |
31 | 45 | ProxyPassReverse / http://127.0.0.1:3000/ |
32 | 46 | ProxyPreserveHost On |
33 | 47 |
|
34 | 48 | CustomLog /var/log/apache2/gitlab/access.log combined |
35 | 49 | ErrorLog /var/log/apache2/gitlab/error.log |
| 50 | + |
| 51 | + # Modify path to your needs (needed for downloading attachments) |
| 52 | + DocumentRoot /home/git/gitlab/public |
| 53 | + |
| 54 | + <Location /> |
| 55 | + Order allow,deny |
| 56 | + Allow from all |
| 57 | + </Location> |
| 58 | + |
36 | 59 | </VirtualHost> |
0 commit comments