Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何解决方案/补丁可以使 nginx 与上游的袜子一起工作?
像这样的东西:
server { location / { proxy_pass socks5://ip:port/ } }
我最近写了一个完全符合您需要的模块。在nginx之前,您可能需要类似HAProxy的东西来支持 TLS 隧道。
SOCKS 是第 5 层,HTTP 是第 7 层。HTTP 代理无法处理 SOCKS,尽管 HTTP 代理可以在SOCKS 上工作。我不清楚如果 Nginx 能够连接到 SOCKS 服务器,你会期望 Nginx 对响应做什么。这类似于询问 Nginx 是否可以连接到 NetBIOS 或 PTPP。
假设您尝试将 Nginx 代理连接到只能通过 SOCKS 访问的另一个 HTTP 服务器,您需要将其设置为操作系统上网络堆栈的一部分。
也许这个链接可以帮助你:
http://www.catonmat.net/blog/linux-socks5-proxy/