Skip to content

Commit 3675d53

Browse files
committed
Merge pull request #4 from NARKOZ/patch-nginx
fix nginx X-Forwarded-Proto header
2 parents eeb092e + 4d0a7e3 commit 3675d53

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

nginx/gitlab

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,25 @@ server {
1010
listen YOUR_SERVER_IP:80; # e.g., listen 192.168.1.1:80;
1111
server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
1212
root /home/gitlab/gitlab/public;
13-
13+
1414
# individual nginx logs for this gitlab vhost
1515
access_log /var/log/nginx/gitlab_access.log;
1616
error_log /var/log/nginx/gitlab_error.log;
17-
17+
1818
location / {
1919
# serve static files from defined root folder;.
2020
# @gitlab is a named location for the upstream fallback, see below
2121
try_files $uri $uri/index.html $uri.html @gitlab;
2222
}
23-
24-
# if a file, which is not found in the root folder is requested,
23+
24+
# if a file, which is not found in the root folder is requested,
2525
# then the proxy pass the request to the upsteam (gitlab unicorn)
2626
location @gitlab {
2727
proxy_redirect off;
28-
29-
# you need to change this to "https", if you set "ssl" directive to "on"
30-
proxy_set_header X-FORWARDED_PROTO http;
28+
proxy_set_header X-Forwarded-Proto $scheme;
3129
proxy_set_header Host $http_host;
3230
proxy_set_header X-Real-IP $remote_addr;
33-
31+
3432
proxy_pass http://gitlab;
3533
}
3634
}

0 commit comments

Comments
 (0)