proxy_pass无法使用/etc/hosts解析DNS [英] proxy_pass does not resolve DNS using /etc/hosts
本文介绍了proxy_pass无法使用/etc/hosts解析DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在nginx中, proxy_pass
指令未使用/etc/hosts
文件解析DNS.有什么方法可以实现这种可能性(也许是通过利用Lua作为最后的手段)?
In nginx the proxy_pass
directive is not resolving DNS using the /etc/hosts
file. Any way to enable this possibility (maybe by leveraging Lua as a last resort)?
推荐答案
简而言之,您需要在本地安装dnsmasq并将127.0.0.1用作解析器.
In short, you need to install dnsmasq locally and use 127.0.0.1 as a resolver.
请参阅以下相关问答:
使用proxy_pass时,可以使用/etc/hosts代替"resolver"来解析域名吗?
这篇关于proxy_pass无法使用/etc/hosts解析DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文