diff --git a/doc/settings/nginx.md b/doc/settings/nginx.md index f6cb44eccd5e768c517930dc2023eb9785852198_ZG9jL3NldHRpbmdzL25naW54Lm1k..0daa870182c8b5650ca2a876cd248a92c732ef5d_ZG9jL3NldHRpbmdzL25naW54Lm1k 100644 --- a/doc/settings/nginx.md +++ b/doc/settings/nginx.md @@ -308,7 +308,7 @@ nginx['hsts_include_subdomains'] = false ``` -By default `max_age` is set for one year, this is how long browser will remember to only connect through HTTPS. +By default `max_age` is set for one year, this is how long browser will remember to only connect through HTTPS. Setting `max_age` to 0 will disable this feature. For more information see: * https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/ @@ -356,6 +356,9 @@ ## Inserting custom NGINX settings into the GitLab server block +Please keep in mind that these custom settings may create conflicts if the +same settings are defined in your `gitlab.rb` file. + If you need to add custom settings into the NGINX `server` block for GitLab for some reason you can use the following setting. @@ -378,7 +381,7 @@ proxy_cache off; proxy_pass http://gitlab-workhorse; ``` - + in the string or in the included nginx config. Without these, any sub-location will return a 404. See [gitlab-ce#30619](https://gitlab.com/gitlab-org/gitlab-ce/issues/30619). @@ -658,6 +661,13 @@ Don't forget to restart Nginx to load the new configuration (on Debian-based systems `sudo service nginx restart`). +#### Troubleshooting + +##### 400 Bad Request: too many Host headers +Make sure you don't have the `proxy_set_header` configuration in +`nginx['custom_gitlab_server_config']` settings and instead use the +['proxy_set_headers'](https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl) configuration in your `gitlab.rb` file. + [recipes-web]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server [selinuxmod]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache#selinux-modifications [http2 protocol]: https://tools.ietf.org/html/rfc7540