diff --git a/README.md b/README.md index 25943c7..89d817a 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ ENV PROXY_REQUEST_BUFFERING="true" - PROXY_CONNECT_READ_TIMEOUT : see [proxy_connect_read_timeout](https://github.com/chobits/ngx_http_proxy_connect_module#proxy_connect_read_timeout) - PROXY_CONNECT_CONNECT_TIMEOUT : see [proxy_connect_connect_timeout](https://github.com/chobits/ngx_http_proxy_connect_module#proxy_connect_connect_timeout) - PROXY_CONNECT_SEND_TIMEOUT : see [proxy_connect_send_timeout](https://github.com/chobits/ngx_http_proxy_connect_module#proxy_connect_send_timeout)) +- Env `DISABLE_IPV6`: If set to `true`, prevents nginx from getting IPv6 addresses from the resolver without needing a [custom resolver config](#custom_nginx_resolvers_configuration) ### Simple (no auth, all cache) diff --git a/entrypoint.sh b/entrypoint.sh index 98574ed..d285348 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -33,6 +33,10 @@ confpath=/etc/nginx/resolvers.conf if [ ! -e $confpath ] then echo "Using auto-determined resolver '$conf' via '$confpath'" + if [[ "a${DISABLE_IPV6}" == "atrue" ]]; then + echo "Disabling IPv6 in '$confpath'" + conf="${conf%;*} ipv6=off;" + fi echo "$conf" > $confpath else echo "Not using resolver config, keep existing '$confpath' -- mounted by user?"