server {
	listen 443 default_server;

	include ssl.conf;

	location = /healthcheck {
		return 200 "I am in good health!";
	}

	location / {
		if ($http_x_forwarded_proto = "http") {
			return 301 https://$host:<%= Proxy.https_port %>$request_uri;
		}

		return 444;
	}
}
<% mappings.each_with_index do |m, i| %>
server {
	listen 443;

	include ssl.conf;

	server_name <%= m.subdomain %>.<%= domain %>;

	location / {
		if ($http_x_forwarded_proto = "http") {
			return 301 https://$host:<%= Proxy.https_port %>$request_uri;
		}

		set $host_<%= i %> <%= m.url %>;
		proxy_pass $host_<%= i %>;
	}
}
<% end %>

server {
	listen 443 default_server;

	include ssl.conf;

	location = /healthcheck {
		return 200 "I am in good health!";
	}

	location / {
		if ($http_x_forwarded_proto = "http") {
			return 301 https://$host:<%= Proxy.https_port %>$request_uri;
		}

		return 444;
	}
}
<% mappings.each do |m| %>
server {
	listen 443;

	include ssl.conf;

	server_name <%= m.subdomain %>.<%= domain %>;

	location / {
		if ($http_x_forwarded_proto = "http") {
			return 301 https://$host:<%= Proxy.https_port %>$request_uri;
		}

		proxy_pass <%= m.url %>;
	}
}
<% end %>

Revert "proxy_pass to a variable to prevent AOT DNS lookup"
Revert "proxy_pass to a variable to prevent AOT DNS lookup"

This reverts commit 02c9cf807fff890e22964c523e31c52bb6cde11e.
