Skip to content

Instantly share code, notes, and snippets.

@mago0
Created April 17, 2017 16:41
Show Gist options
  • Save mago0/9c5dbfaccc67f15702d9e6b95ea4f9f8 to your computer and use it in GitHub Desktop.
Save mago0/9c5dbfaccc67f15702d9e6b95ea4f9f8 to your computer and use it in GitHub Desktop.
server {
listen 5014;
server_name localhost;
<% upstream = node["app_www"]["upstream_host"][node["region"]] %>
<% if upstream.include? "tilt.net" %>
<% nameserver = "#{node['ipaddress'].scan(/^(\d+\.\d+).+/)[0][0]}.0.2" %>
resolver <%=nameserver%> valid=30s;
resolver_timeout 10s;
<% end %>
set $upstream "<%=upstream%>";
location / {
access_log /var/log/nginx/varnish_to_elb_access.log;
error_log /var/log/nginx/varnish_to_elb_error.log;
proxy_pass $upstream;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment