Docker Network Nginx Resolver

前端 未结 6 1618
挽巷
挽巷 2020-11-30 23:49

I am trying to get rid of deprecated Docker links in my configuration. What\'s left is getting rid of those Bad Gateway nginx reverse proxy errors when I recrea

6条回答
  •  执念已碎
    2020-12-01 00:38

    First off, you should be using the Docker embedded DNS server at 127.0.0.11.

    Your problem could be caused by 1 of the following:

    1. nginx is trying to use IPv6 (AAAA record) for the DNS queries.

      See https://stackoverflow.com/a/35516395/1529493 for the solution.

      Basically something like:

      http {
          resolver 127.0.0.11 ipv6=off;
      }
      

      This is probably no longer a problem with Docker 1.11:

      Fix to not forward docker domain IPv6 queries to external servers (#21396)

    2. Take care that you don't accidentally override the resolver configuration directive. In my case I had in the server block resolver 8.8.8.8 8.8.4.4; from Mozilla's SSL Configuration Generator, which was overriding the resolver 127.0.0.11; in the http block. That had me scratching my head for a long time...

提交回复
热议问题