Created
April 9, 2020 22:03
-
-
Save jakenotjacob/89cc2193a5667b952660960f79368b68 to your computer and use it in GitHub Desktop.
Basic proxy app NGINX
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
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