diff --git a/README.md b/README.md index 069e64eb1415707c5947845e7ab1ad5c4e09292c_UkVBRE1FLm1k..208638ac19e5f80adbd9ef305281a859fbd498f0_UkVBRE1FLm1k 100644 --- a/README.md +++ b/README.md @@ -527,6 +527,10 @@ See [doc/settings/nginx.md](doc/settings/nginx.md). +### Inserting custom settings into the NGINX config + +See [doc/settings/nginx.md](doc/settings/nginx.md). + ## Backups ### Creating an application backup diff --git a/doc/settings/nginx.md b/doc/settings/nginx.md index 069e64eb1415707c5947845e7ab1ad5c4e09292c_ZG9jL3NldHRpbmdzL25naW54Lm1k..208638ac19e5f80adbd9ef305281a859fbd498f0_ZG9jL3NldHRpbmdzL25naW54Lm1k 100644 --- a/doc/settings/nginx.md +++ b/doc/settings/nginx.md @@ -4,9 +4,9 @@ ### Warning -The Nginix config will tell browsers and clients to only communicate with your -GitLab instance over a secure connection for the next 24 months. By enabling -HTTPS you'll need to provide a secure connection to your instance for at least +The Nginix config will tell browsers and clients to only communicate with your +GitLab instance over a secure connection for the next 24 months. By enabling +HTTPS you'll need to provide a secure connection to your instance for at least the next 24 months. By default, omnibus-gitlab does not use HTTPS. If you want to enable HTTPS for @@ -150,6 +150,19 @@ Run `gitlab-ctl reconfigure` to rewrite the NGINX configuration and restart NGINX. +## Inserting custom settings into the NGINX config + +If you need to add custom settings into the NGINX config, for example to include +existing server blocks, you can use the following setting. + +```ruby +# Example: include a directory to scan for additional config files +nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/*.conf;" +``` + +Run `gitlab-ctl reconfigure` to rewrite the NGINX configuration and restart +NGINX. + ## Using an existing Passenger/Nginx installation In some cases you may want to host GitLab using an existing Passenger/Nginx diff --git a/files/gitlab-cookbooks/gitlab/attributes/default.rb b/files/gitlab-cookbooks/gitlab/attributes/default.rb index 069e64eb1415707c5947845e7ab1ad5c4e09292c_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvYXR0cmlidXRlcy9kZWZhdWx0LnJi..208638ac19e5f80adbd9ef305281a859fbd498f0_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvYXR0cmlidXRlcy9kZWZhdWx0LnJi 100644 --- a/files/gitlab-cookbooks/gitlab/attributes/default.rb +++ b/files/gitlab-cookbooks/gitlab/attributes/default.rb @@ -304,6 +304,7 @@ default['gitlab']['nginx']['ssl_session_timeout'] = "5m" # default according to http://nginx.org/en/docs/http/ngx_http_ssl_module.html default['gitlab']['nginx']['listen_addresses'] = ['*'] default['gitlab']['nginx']['custom_gitlab_server_config'] = nil +default['gitlab']['nginx']['custom_nginx_config'] = nil ### # Logging diff --git a/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb b/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb index 069e64eb1415707c5947845e7ab1ad5c4e09292c_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvbmdpbnguY29uZi5lcmI=..208638ac19e5f80adbd9ef305281a859fbd498f0_ZmlsZXMvZ2l0bGFiLWNvb2tib29rcy9naXRsYWIvdGVtcGxhdGVzL2RlZmF1bHQvbmdpbnguY29uZi5lcmI= 100644 --- a/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb +++ b/files/gitlab-cookbooks/gitlab/templates/default/nginx.conf.erb @@ -32,4 +32,6 @@ <% if @gitlab_ci_http_config %> include <%= @gitlab_ci_http_config %>; <% end %> + + <%= @custom_nginx_config %> }