Add DISABLE_IPV6 to ignore AAAA records when proxying requests

pull/142/head
DJ Gregor 2022-10-18 23:43:07 -04:00
parent fcf8fc1ca2
commit c67c0baf10
3 changed files with 9 additions and 1 deletions

View File

@ -117,5 +117,8 @@ ENV PROXY_CONNECT_READ_TIMEOUT="60s"
ENV PROXY_CONNECT_CONNECT_TIMEOUT="60s" ENV PROXY_CONNECT_CONNECT_TIMEOUT="60s"
ENV PROXY_CONNECT_SEND_TIMEOUT="60s" ENV PROXY_CONNECT_SEND_TIMEOUT="60s"
# Disable use of IPv6 hosts for outbound proxy requests if set to true
ENV DISABLE_IPV6="false"
# Did you want a shell? Sorry, the entrypoint never returns, because it runs nginx itself. Use 'docker exec' if you need to mess around internally. # Did you want a shell? Sorry, the entrypoint never returns, because it runs nginx itself. Use 'docker exec' if you need to mess around internally.
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

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_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_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)) - 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 you have problems with `nginx` attempting to connect to hosts over IPv6 but your network doesn't properly support IPv6, set this to `true` to ignore IPv6 AAAA records in DNS responses.
### Simple (no auth, all cache) ### Simple (no auth, all cache)

View File

@ -25,7 +25,11 @@ echo "DEBUG, determined RESOLVERS from /etc/resolv.conf: '$RESOLVERS'"
conf="" conf=""
for ONE_RESOLVER in ${RESOLVERS}; do for ONE_RESOLVER in ${RESOLVERS}; do
echo "Possible resolver: $ONE_RESOLVER" echo "Possible resolver: $ONE_RESOLVER"
if [[ "a${DISABLE_IPV6}" == "atrue" ]]; then
conf="resolver $ONE_RESOLVER ipv6=off; "
else
conf="resolver $ONE_RESOLVER; " conf="resolver $ONE_RESOLVER; "
fi
done done
echo "Final chosen resolver: $conf" echo "Final chosen resolver: $conf"