Created
April 17, 2017 16:41
-
-
Save mago0/9c5dbfaccc67f15702d9e6b95ea4f9f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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