Opened 11 years ago
Closed 11 years ago
#484 closed defect (invalid)
Core module fails to resolve AAAA records
Reported by: | Vadim Grinco | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | nginx-core | Version: | 1.4.x |
Keywords: | Cc: | ||
uname -a: | 3.8.0-30-lowlatency | ||
nginx -V: |
nginx version: nginx/1.4.1 (Ubuntu)
TLS SNI support enabled configure arguments: --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-mail --with-mail_ssl_module --add-module=/build/buildd/nginx-1.4.1/debian/modules/nginx-auth-pam --add-module=/build/buildd/nginx-1.4.1/debian/modules/nginx-dav-ext-module --add-module=/build/buildd/nginx-1.4.1/debian/modules/nginx-echo --add-module=/build/buildd/nginx-1.4.1/debian/modules/nginx-upstream-fair --add-module=/build/buildd/nginx-1.4.1/debian/modules/ngx_http_substitutions_filter_module |
Description
I have the following section in my config file:
location ~* /get/(.*?)/(.*) {
resolver 127.0.0.1;
set $upstream_uri $2;
set $upstream_host $1;
set $upstream_url http://$upstream_host/$upstream_uri;
proxy_set_header Host $upstream_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $upstream_url;
}
Everything works just fine as long as use ipv4 enabled domain names, but when I try to access an ipv6 site through the proxy, it doesn't try to resolve AAAA and fails:
*36 ipv6-only.host-name.com could not be resolved (3: Host not found), client: ::ffff:192.168.1.4, server: localhost, request: "GET /get/ipv6-only.host-name.com/ HTTP/1.1", host: "192.168.1.254:8000"
In this particular situation I want to use nginx as a proxy between ipv4 only and ipv6 only networks. I tried adding a few rules statically, and it works. I mean something like this works:
proxy_set_header Host ipv6-only.host-name.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://ipv6-only.host-name.com/;
I was wondering whether you can try resolving an AAAA record if ipv6 is enabled, and core fails to resolve and A record.
Let me know if you need help reproducing.
Thanks,
A quote from the documentation:
The official Ubuntu packages of 1.5.8+ are available here:
http://nginx.org/en/linux_packages.html#mainline