1
1
## GitLab
2
2
## Contributors: randx, yin8086, sashkab, orkoden, axilleas
3
- ## App Version: 5.4 - 6.0
4
3
##
5
4
## Modified from nginx http version
6
5
## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
53
52
54
53
upstream gitlab {
55
54
56
- ## Uncomment if you have set up puma/ unicorn to listen on a unix socket (recommended).
55
+ ## Uncomment if you have set up unicorn to listen on a unix socket (recommended).
57
56
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
58
57
59
- ## Uncomment if puma/ unicorn are configured to listen on a tcp port.
60
- ## Check the port number in /home/git/gitlab/config/{puma.rb/ unicorn.rb}
58
+ ## Uncomment if unicorn is configured to listen on a tcp port.
59
+ ## Check the port number in /home/git/gitlab/config/unicorn.rb
61
60
# server 127.0.0.1:8080;
62
61
}
63
62
@@ -67,8 +66,7 @@ server {
67
66
## Replace git.example.com with your FQDN.
68
67
server_name git.example.com;
69
68
server_tokens off;
70
- ## This doesn't have to be a valid path since we are redirecting,
71
- ## you don't have to change it.
69
+ ## root doesn't have to be a valid path since we are redirecting
72
70
root /nowhere;
73
71
rewrite ^ https://$server_name$request_uri permanent;
74
72
}
@@ -140,17 +138,21 @@ server {
140
138
proxy_connect_timeout 300;
141
139
proxy_redirect off;
142
140
143
- proxy_set_header Host $http_host;
144
- proxy_set_header X-Real-IP $remote_addr;
145
- proxy_set_header X-Forwarded-Ssl on;
146
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
147
- proxy_set_header X-Forwarded-Proto $scheme;
141
+ proxy_set_header Host $http_host;
142
+ proxy_set_header X-Real-IP $remote_addr;
143
+ proxy_set_header X-Forwarded-Ssl on;
144
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
145
+ proxy_set_header X-Forwarded-Proto $scheme;
146
+ proxy_set_header X-Frame-Options SAMEORIGIN;
148
147
149
148
proxy_pass http://gitlab;
150
149
}
151
150
152
151
## Enable gzip compression as per rails guide:
153
152
## http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression
153
+ ## WARNING: If you are using relative urls do remove the block below
154
+ ## See config/application.rb under "Relative url support" for the list of
155
+ ## other files that need to be changed for relative url support
154
156
location ~ ^/(assets)/ {
155
157
root /home/git/gitlab/public;
156
158
gzip_static on; # to serve pre-gzipped version
0 commit comments