Skip to content

Commit d7e5e7e

Browse files
authored
Merge pull request #2517 from kkimurak/issue/2515-support-nginx-custom-config
add NGINX_CUSTOM_GITLAB_SERVER_CONFIG
2 parents 739480e + a9b4feb commit d7e5e7e

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ Below is the complete list of available options that can be used to customize yo
10011001
| `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`. |
10021002
| `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. |
10031003
| `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. |
1004+
| `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. |
10041005
| `REDIS_HOST` | The hostname of the redis server. Defaults to `localhost` |
10051006
| `REDIS_PORT` | The connection port of the redis server. Defaults to `6379`. |
10061007
| `REDIS_DB_NUMBER` | The redis database number. Defaults to '0'. |

assets/runtime/config/nginx/gitlab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,5 @@ server {
9494
internal;
9595
}
9696

97+
{{NGINX_CUSTOM_GITLAB_SERVER_CONFIG}}
9798
}

assets/runtime/config/nginx/gitlab-ssl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,6 @@ server {
139139
root {{GITLAB_INSTALL_DIR}}/public;
140140
internal;
141141
}
142+
143+
{{NGINX_CUSTOM_GITLAB_SERVER_CONFIG}}
142144
}

assets/runtime/env-defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ case ${GITLAB_HTTPS} in
312312
true) NGINX_X_FORWARDED_PROTO=${NGINX_X_FORWARDED_PROTO:-https} ;;
313313
*) NGINX_X_FORWARDED_PROTO=${NGINX_X_FORWARDED_PROTO:-\$scheme} ;;
314314
esac
315+
NGINX_CUSTOM_GITLAB_SERVER_CONFIG=${NGINX_CUSTOM_GITLAB_SERVER_CONFIG:-}
315316

316317
## MAIL DELIVERY
317318
SMTP_DOMAIN=${SMTP_DOMAIN:-www.gmail.com}

assets/runtime/functions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@ nginx_configure_gitlab() {
13291329
GITLAB_PORT \
13301330
NGINX_PROXY_BUFFERING \
13311331
NGINX_ACCEL_BUFFERING \
1332-
NGINX_X_FORWARDED_PROTO
1332+
NGINX_X_FORWARDED_PROTO \
1333+
NGINX_CUSTOM_GITLAB_SERVER_CONFIG
13331334

13341335
nginx_configure_gitlab_ssl
13351336
nginx_configure_gitlab_hsts

0 commit comments

Comments
 (0)