diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-02-21 00:32:46 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-02-01 01:55:28 +0300 |
commit | 50bbc326a475f0cca8e63c7a8de96b3f5538cee0 (patch) | |
tree | 0a8bb2c18c24460b408289b8c8c2bbf131130501 /lib/support/nginx/gitlab-pages | |
parent | d5ccea0286b229ba64a50e4576a68674d83ef30b (diff) |
Change NGINX pages configs to account for the Pages daemon
Diffstat (limited to 'lib/support/nginx/gitlab-pages')
-rw-r--r-- | lib/support/nginx/gitlab-pages | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/support/nginx/gitlab-pages b/lib/support/nginx/gitlab-pages index ed4f7e4316a..2e0eb2af4b1 100644 --- a/lib/support/nginx/gitlab-pages +++ b/lib/support/nginx/gitlab-pages @@ -8,20 +8,18 @@ server { ## Replace this with something like pages.gitlab.com server_name ~^(?<group>.*)\.YOUR_GITLAB_PAGES\.DOMAIN$; - root /home/git/gitlab/shared/pages/${group}; ## Individual nginx logs for GitLab pages access_log /var/log/nginx/gitlab_pages_access.log; error_log /var/log/nginx/gitlab_pages_error.log; - # 1. Try to get /path/ from shared/pages/${group}/${path}/public/ - # 2. Try to get / from shared/pages/${group}/${host}/public/ - location ~ ^/([^/]*)(/.*)?$ { - try_files "/$1/public$2" - "/$1/public$2/index.html" - "/${host}/public/${uri}" - "/${host}/public/${uri}/index.html" - =404; + location / { + proxy_set_header Host $http_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; + # The same address as passed to GitLab Pages: `-listen-proxy` + proxy_pass http://localhost:8282/; } # Define custom error pages |