When using proxy_pass, can /etc/hosts be used to resolve domain names instead of “resolver”?

前端 未结 2 848
再見小時候
再見小時候 2020-12-07 21:38

Can /etc/hosts be used instead of resolver when using proxy_pass?

I need to perform a proxy_pass to the same nginx

2条回答
  •  悲哀的现实
    2020-12-07 21:51

    You can get around this by installing dnsmasq and setting your resolver to 127.0.0.1. Basically this uses your local DNS as a resolver, but it only resolves what it knows about (among those things is your /etc/hosts) and forwards the rest to your default DNS.

提交回复
热议问题