disable IPv6 via env

pull/130/head
moonbuggy 2022-03-22 16:16:22 +11:00
parent 45ad55d3f1
commit f80fc35575
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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?"