为什么Nginx的proxy_pass向上游发送有时候传出的请求到IPv6?
2015/12/28 14:11:06 [error] 38194#0: *114469948 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xx.xxx, server: example.com, request: "POST /suggest/ HTTP/1.1", upstream: "http://[AAAA:BBB:CCC:DDDD::E]:5555/suggestion", host: "example.com", referrer: "https://example.com/en/apple-111111/"
nginx.conf:
location /suggest/ { proxy_pass http://testserver.com:5555/suggestion; proxy_set_header Authorization 'Basic xxx'; }
而不是发送请求到我们的testserver.com请求去http:// [AAAA:BBB:CCC:DDDD :: E]:5555 /build议
有人知道IPv6地址来自哪里,或者nginx conf有什么问题?
感谢您的build议,汉斯
这是一个真实的例子:
2015/12/28 14:11:03 [error] 38192#0: *114552633 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xxx, server: pixabay.com, request: "POST /suggest/ HTTP/1.1", upstream: "http://[2a01:4f8:160:4450::2]:5555/pixabay/suggestion", host: "pixabay.com", referrer: "https://pixabay.com/fr/"
和nginx.conf:
location /suggest/ { proxy_pass http://pagewizz.com:5555/pixabay/suggestion; proxy_set_header Authorization 'Basic xxx'; }
我们正在运行一个名为Pixabay的大型图像数据库。 为了search,我们使用在另一台名为Pagewizz(2a01:4f8:160:4450 :: 2)的服务器上运行的elasticsearch。 如果有人正在标记图像,我们使用弹性来获得build议。 我不知道为什么PageWizz的ipv6地址出现在nginx的错误日志中…