Add option to disable IPV6 for resolving

master
Jonas Letzbor 2023-12-27 15:19:41 +01:00
parent fcf8fc1ca2
commit 0d6e3d6890
Signed by: RPJosh
GPG Key ID: 46D72F589702E55A
4 changed files with 21 additions and 1 deletions

View File

@ -116,6 +116,7 @@ ENV PROXY_SEND_TIMEOUT="60s"
ENV PROXY_CONNECT_READ_TIMEOUT="60s"
ENV PROXY_CONNECT_CONNECT_TIMEOUT="60s"
ENV PROXY_CONNECT_SEND_TIMEOUT="60s"
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.
ENTRYPOINT ["/entrypoint.sh"]

14
MyNotes.md 100644
View File

@ -0,0 +1,14 @@
## Build
```sh
buildah bud --layers -f Dockerfile \
--tag=rpjosh.de/docker-registry-proxy:0.0.0-dev
```
## Publish
```
podman login git.rpjosh.de
podman tag rpjosh.de/docker-registry-proxy:0.0.0-dev git.rpjosh.de/rpjosh/docker-registry-proxy:0.7.0
podman push git.rpjosh.de/rpjosh/docker-registry-proxy:0.7.0
```

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

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