# Set example.org to 127.0.0.1 in /etc/hosts, then trigger the bug
# by accessing one of these URLs:
# https://example.org
# https://example.org:8443

events {
	worker_connections 1024;
}

stream {
	resolver 1.1.1.1;

	server {
		listen 443;
		ssl_preread on;
		# Hostnames are statically resolved to IPv6-only
		# Trigger the bug by binding to IPv4 local address
		proxy_bind 0.0.0.0;
		proxy_pass example.com:443;
	}

	server {
		listen 8443;
		ssl_preread on;
		# Hostnames are dynamically resolved to IPv4-only
		# Trigger the bug by binding to IPv6 local address
		proxy_bind ::;
		proxy_pass $ssl_preread_server_name:443;
	}
}
