tiredofit / docker-nginx

Dockerized webserver with many customizable options
MIT License
24 stars 10 forks source link

support resolver by default #19

Open terryzwt opened 1 month ago

terryzwt commented 1 month ago

I have a similar problem like below post: https://www.emmanuelgautier.com/blog/nginx-docker-dns-resolution

After add the resolver 127.0.0.11;, problem resolved.

terryzwt commented 1 month ago

I think it's better to add an environment: NGINX_RESOLVER to set up the resolver manually. For example, if I run this image in k8s, the resolver should like this: resolver kube-dns.kube-system.svc.cluster.local;

ref: https://serverfault.com/questions/638822/nginx-resolver-address-from-etc-resolv-conf

tiredofit commented 1 month ago

I agree, if the user wishes to use this environment variable it should be customizable. I see that you have put some time into a PR to support this. I can review tomorrow and see what needs to done to support a single or multiple resolvers to solve this issue..

tiredofit commented 1 month ago

I reworked your PR into 6.5.0 https://github.com/tiredofit/docker-nginx/commit/62b4ad7521b7181e4f9697f189b0f4feabc1d337

Have a peek and see if this works for you!