diff options
author | 3kami3 <github@yumimix.org> | 2017-03-01 23:16:38 +0900 |
---|---|---|
committer | 3kami3 <github@yumimix.org> | 2017-03-01 23:16:38 +0900 |
commit | 1bc5dab7b4f2650b5afb7c0e4c70e5ac9f66eba0 (patch) | |
tree | 5ee89f6dae24bfa7ca47bc652c2c2789699936d4 /lib | |
parent | 462526280a8996975ab53a61fee4f74e5d2ed7fd (diff) | |
download | gitlab-ce-1bc5dab7b4f2650b5afb7c0e4c70e5ac9f66eba0.tar.gz |
Add real_ip setting to nginx example.
ref)
https://docs.gitlab.com/omnibus/settings/nginx.html#configuring-gitlab-trusted_proxies-and-the-nginx-real_ip-module
Diffstat (limited to 'lib')
-rw-r--r-- | lib/support/nginx/gitlab | 6 | ||||
-rw-r--r-- | lib/support/nginx/gitlab-ssl | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab index 2f7c34a3f31..78f28347d1a 100644 --- a/lib/support/nginx/gitlab +++ b/lib/support/nginx/gitlab @@ -38,6 +38,12 @@ server { ## See app/controllers/application_controller.rb for headers set + ## Real IP Module Config + ## http://nginx.org/en/docs/http/ngx_http_realip_module.html + real_ip_header X-Real-IP; ## X-Real-IP or X-Forwarded-For or proxy_protocol + real_ip_recursive off; ## If you enable 'on' + set_real_ip_from YOUR_TRUSTED_ADDRESS; ## Replace this with something like 192.168.1.0/24 + ## Individual nginx logs for this GitLab vhost access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl index 5661394058d..1bccb1c2451 100644 --- a/lib/support/nginx/gitlab-ssl +++ b/lib/support/nginx/gitlab-ssl @@ -82,6 +82,12 @@ server { ## # ssl_dhparam /etc/ssl/certs/dhparam.pem; + ## Real IP Module Config + ## http://nginx.org/en/docs/http/ngx_http_realip_module.html + real_ip_header X-Real-IP; ## X-Real-IP or X-Forwarded-For or proxy_protocol + real_ip_recursive off; ## If you enable 'on' + set_real_ip_from YOUR_TRUSTED_ADDRESS; ## Replace this with something like 192.168.1.0/24 + ## Individual nginx logs for this GitLab vhost access_log /var/log/nginx/gitlab_access.log; error_log /var/log/nginx/gitlab_error.log; |