Skip to content

Instantly share code, notes, and snippets.

@jakenotjacob
Created April 9, 2020 22:03
Show Gist options
  • Save jakenotjacob/89cc2193a5667b952660960f79368b68 to your computer and use it in GitHub Desktop.
Save jakenotjacob/89cc2193a5667b952660960f79368b68 to your computer and use it in GitHub Desktop.
Basic proxy app NGINX
upstream <%= @name %> {
server <%= @upstream_server %> fail_timeout=0;
}
server {
<%= "listen #{@listen};" unless @listen.nil? %>
<%= "root #{@root};" unless @root.nil? %>
client_max_body_size 0;
try_files $uri/index.html $uri.html $uri @<%= @name %>;
location @<%= @name %> {
<% @proxy_set_header.each do |name,value| %>
proxy_set_header <%= name %> <%= value %>;
<% end %>
proxy_redirect off;
proxy_pass http://<%= @name %>;
<%= "proxy_read_timeout #{@proxy_read_timeout};" if @proxy_read_timeout %>
}
<%= render @conf_source, :variables => @conf_variables unless @conf_source.nil? %>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment