Skip to content

Commit a57d902

Browse files
committed
Update to be on par with latest upstream
1 parent 4efadad commit a57d902

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

web-server/nginx/gitlab-ssl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## GitLab
22
## Contributors: randx, yin8086, sashkab, orkoden, axilleas
3-
## App Version: 5.4 - 6.0
43
##
54
## Modified from nginx http version
65
## Modified from http://blog.phusion.nl/2012/04/21/tutorial-setting-up-gitlab-on-debian-6/
@@ -53,11 +52,11 @@
5352

5453
upstream gitlab {
5554

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).
5756
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
5857

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
6160
# server 127.0.0.1:8080;
6261
}
6362

@@ -67,8 +66,7 @@ server {
6766
## Replace git.example.com with your FQDN.
6867
server_name git.example.com;
6968
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
7270
root /nowhere;
7371
rewrite ^ https://$server_name$request_uri permanent;
7472
}
@@ -140,17 +138,21 @@ server {
140138
proxy_connect_timeout 300;
141139
proxy_redirect off;
142140

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;
148147

149148
proxy_pass http://gitlab;
150149
}
151150

152151
## Enable gzip compression as per rails guide:
153152
## 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
154156
location ~ ^/(assets)/ {
155157
root /home/git/gitlab/public;
156158
gzip_static on; # to serve pre-gzipped version

0 commit comments

Comments
 (0)