diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-07-12 18:06:49 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-07-12 18:06:49 -0500 |
commit | 67668d9de67839dad746ad16ca46721bfa89ddc3 (patch) | |
tree | ba59a032227362e40bdbbd809bfa03d73092d96f /lib | |
parent | db9dc7a3aef0461359d701729bcf1641996637cc (diff) | |
parent | 47b5b441395921e9f8e9982bb3f560e5db5a67bc (diff) | |
download | gitlab-ce-67668d9de67839dad746ad16ca46721bfa89ddc3.tar.gz |
Merge branch 'jacobvosmaer-gitlab/gitlab-ce-strict-host-headers'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/support/nginx/gitlab | 7 | ||||
-rw-r--r-- | lib/support/nginx/gitlab-ssl | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index d521de28e8a..4a4892a2e07 100644 --- a/lib/support/nginx/gitlab +++ b/lib/support/nginx/gitlab @@ -49,7 +49,12 @@ server { proxy_http_version 1.1; - proxy_set_header Host $http_host; + ## By overwriting Host and clearing X-Forwarded-Host we ensure that + ## internal HTTP redirects generated by GitLab always send users to + ## YOUR_SERVER_FQDN. + proxy_set_header Host YOUR_SERVER_FQDN; + proxy_set_header X-Forwarded-Host ""; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl index bf014b56cf6..0b93d7f292f 100644 --- a/lib/support/nginx/gitlab-ssl +++ b/lib/support/nginx/gitlab-ssl @@ -93,7 +93,12 @@ server { proxy_http_version 1.1; - proxy_set_header Host $http_host; + ## By overwriting Host and clearing X-Forwarded-Host we ensure that + ## internal HTTP redirects generated by GitLab always send users to + ## YOUR_SERVER_FQDN. + proxy_set_header Host YOUR_SERVER_FQDN; + proxy_set_header X-Forwarded-Host ""; + proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |