Automatically detect hostname with map als ssl preread

openworx nginx-forum at
Mon Feb 7 12:06:28 UTC 2022

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

stream {
  map $ssl_preread_server_name $selected_upstream { upstream_1; upstream_2; 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:,293604,293604#msg-293604

More information about the nginx mailing list