views:

9

answers:

0

Hi folks,

i have a nginx server running on ipv6 native. I want to set up a "proxy" to ipv4 with it.

server {
    listen [::]:80;
    location / {
            proxy_pass http://www.mydomain.com
            proxy_set_header  X-Real-IP  $remote_addr;

    }
}

The Idea is to set up a AAAA record "ipv6.mydomain.com", and nginx should change the "ipv6" part to www and request the data over ipv4 from the real host.

What i need is something like that:

proxy_pass http://www.$domain.$tld

How can i do that within the nginx config?