在nginx中,proxy_pass指令不使用/ etc / hosts文件解析DNS.任何方式来实现这种可能性(可能通过利用Lua作为最后的手段)?
最佳答案
简而言之,您需要在本地安装dnsmasq并使用127.0.0.1作为解析程序.
看到这个相关的问题和答案:
When using proxy_pass,can /etc/hosts be used to resolve domain names instead of “resolver”?
在nginx中,proxy_pass指令不使用/ etc / hosts文件解析DNS.任何方式来实现这种可能性(可能通过利用Lua作为最后的手段)?
最佳答案
简而言之,您需要在本地安装dnsmasq并使用127.0.0.1作为解析程序.
看到这个相关的问题和答案:
When using proxy_pass,can /etc/hosts be used to resolve domain names instead of “resolver”?