[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nginx
Subject:    Automatically detect hostname with map als ssl preread
From:       "openworx" <nginx-forum () forum ! nginx ! org>
Date:       2022-02-07 12:06:28
Message-ID: ceb3c964472c23cc06bf2a338f360eaa.NginxMailingListEnglish () forum ! nginx ! org
[Download RAW message or body]

I have a IPv4 to IPv6 reverse proxy server so that IPv4 clients can access
IPv6 only websites. For each website the website domain and the
corresponding IPv6 address must be added manually. Is there a way to
automatically detect the AAAA record from the website and use this in
upstream?

stream {
  map $ssl_preread_server_name $selected_upstream {
    www.website1.com upstream_1;
    www.website2.com upstream_2;
    www.website3.com upstream_3;
  }
  upstream upstream_1 { server [2001:x:x:x::f:244]:443; }
  upstream upstream_2 { server [2001:x:x:x::f:245]:443; }
  upstream upstream_3 { server [2001:x:x:x::f:246]:443; }
  
  server {
    listen 443;
    proxy_pass $selected_upstream;
    ssl_preread on;
  }
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293604,293604#msg-293604

_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic