diff --git a/README.md b/README.md index c994ae4f..ead2ef2a 100644 --- a/README.md +++ b/README.md @@ -1001,6 +1001,7 @@ Below is the complete list of available options that can be used to customize yo | `NGINX_X_FORWARDED_PROTO` | Advanced configuration option for the `proxy_set_header X-Forwarded-Proto` setting in the gitlab nginx vHost configuration. Defaults to `https` when `GITLAB_HTTPS` is `true`, else defaults to `$scheme`. | | `NGINX_REAL_IP_RECURSIVE` | set to `on` if docker container runs behind a reverse proxy,you may not want the IP address of the proxy to show up as the client address. `off` by default. | | `NGINX_REAL_IP_TRUSTED_ADDRESSES` | You can have NGINX look for a different address to use by adding your reverse proxy to the `NGINX_REAL_IP_TRUSTED_ADDRESSES`. Currently only a single entry is permitted. No defaults. | +| `NGINX_CUSTOM_GITLAB_SERVER_CONFIG` | Advanced configuration option. You can add custom configuration for nginx as you like (e.g. custom location proxy). This is similar to setting `nginx['custom_gitlab_server_config']` to `gitlab.rb` for gitlab-omnibus. No defaults. | | `REDIS_HOST` | The hostname of the redis server. Defaults to `localhost` | | `REDIS_PORT` | The connection port of the redis server. Defaults to `6379`. | | `REDIS_DB_NUMBER` | The redis database number. Defaults to '0'. | diff --git a/assets/runtime/config/nginx/gitlab b/assets/runtime/config/nginx/gitlab index b08c8bff..c2e22a29 100644 --- a/assets/runtime/config/nginx/gitlab +++ b/assets/runtime/config/nginx/gitlab @@ -94,4 +94,5 @@ server { internal; } + {{NGINX_CUSTOM_GITLAB_SERVER_CONFIG}} } diff --git a/assets/runtime/config/nginx/gitlab-ssl b/assets/runtime/config/nginx/gitlab-ssl index 7e7be7bf..893232b7 100644 --- a/assets/runtime/config/nginx/gitlab-ssl +++ b/assets/runtime/config/nginx/gitlab-ssl @@ -139,4 +139,6 @@ server { root {{GITLAB_INSTALL_DIR}}/public; internal; } + + {{NGINX_CUSTOM_GITLAB_SERVER_CONFIG}} } diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 8015ec1c..661219a3 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -312,6 +312,7 @@ case ${GITLAB_HTTPS} in true) NGINX_X_FORWARDED_PROTO=${NGINX_X_FORWARDED_PROTO:-https} ;; *) NGINX_X_FORWARDED_PROTO=${NGINX_X_FORWARDED_PROTO:-\$scheme} ;; esac +NGINX_CUSTOM_GITLAB_SERVER_CONFIG=${NGINX_CUSTOM_GITLAB_SERVER_CONFIG:-} ## MAIL DELIVERY SMTP_DOMAIN=${SMTP_DOMAIN:-www.gmail.com} diff --git a/assets/runtime/functions b/assets/runtime/functions index 8d1ca5ec..b42936df 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -1329,7 +1329,8 @@ nginx_configure_gitlab() { GITLAB_PORT \ NGINX_PROXY_BUFFERING \ NGINX_ACCEL_BUFFERING \ - NGINX_X_FORWARDED_PROTO + NGINX_X_FORWARDED_PROTO \ + NGINX_CUSTOM_GITLAB_SERVER_CONFIG nginx_configure_gitlab_ssl nginx_configure_gitlab_hsts