diff --git a/nginx_proxy/DOCS.md b/nginx_proxy/DOCS.md index 12e20603b..5c4c5dd88 100644 --- a/nginx_proxy/DOCS.md +++ b/nginx_proxy/DOCS.md @@ -64,7 +64,7 @@ Value for the [`Strict-Transport-Security`][hsts] HTTP header to send. If empty, ### Option `customize.active` (required) -If true, additional NGINX configuration files for the default server and additional servers are read from files in the `/share` directory specified by the `default` and `servers` variables. +If true, additional NGINX configuration files for the default server and additional servers are read from files in the `/share` directory specified by the `default`, `servers`, and `root_conf` variables. ### Option `customize.default` (required) @@ -74,6 +74,10 @@ The filename of the NGINX configuration for the default server, found in the `/s The filename(s) of the NGINX configuration for the additional servers, found in the `/share` directory. +### Option `customize.root_conf` (required) + +The filename of the NGINX configuration for additional parameters to place in the root level of the configuration file, found in the `/share` directory. + ### Option `cloudflare` (optional) If enabled, configure Nginx with a list of IP addresses directly from Cloudflare that will be used for `set_real_ip_from` directive Nginx config. diff --git a/nginx_proxy/config.yaml b/nginx_proxy/config.yaml index 25bc4c190..1dceb8e59 100644 --- a/nginx_proxy/config.yaml +++ b/nginx_proxy/config.yaml @@ -24,6 +24,7 @@ options: active: false default: nginx_proxy_default*.conf servers: nginx_proxy/*.conf + root_conf: nginx_root_conf*.conf real_ip_from: [] ports: 443/tcp: 443 @@ -40,5 +41,6 @@ schema: active: bool default: str servers: str + root_conf: str real_ip_from: - str diff --git a/nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl b/nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl index 57dbe0ba7..371ff343a 100644 --- a/nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl +++ b/nginx_proxy/rootfs/etc/nginx/nginx.conf.gtpl @@ -10,6 +10,10 @@ events { worker_connections 1024; } +{{- if .options.customize.active }} +include /share/{{ .options.customize.root_conf }}; +{{- end }} + http { map_hash_bucket_size 128;