Skip to content

Commit

Permalink
Add proxy_pass in directory template for location directive
Browse files Browse the repository at this point in the history
  • Loading branch information
toteva committed Jul 24, 2017
1 parent 40c1ad4 commit 594d115
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,39 @@
<%- end -%>
<%- end -%>
<%- end -%>
<%- if directory['proxy_pass'] and directory['provider'] and directory['provider'].match('location') -%>
<%- directory['proxy_pass'].flatten.compact.each do |proxy| -%>
ProxyPass <%= proxy['url'] %>
<%- if proxy['params'] -%>
<%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%>
<%- end -%>
<%- end -%>
<%- if proxy['keywords'] %> <%= proxy['keywords'].join(' ') -%>
<%- end %>
<%- if not proxy['reverse_cookies'].nil? -%>
<%- Array(proxy['reverse_cookies']).each do |reverse_cookies| -%>
<%- if reverse_cookies['path'] -%>
ProxyPassReverseCookiePath <%= reverse_cookies['path'] %> <%= reverse_cookies['url'] %>
<%- end -%>
<%- if reverse_cookies['domain'] -%>
ProxyPassReverseCookieDomain <%= reverse_cookies['domain'] %> <%= reverse_cookies['url'] %>
<%- end -%>
<%- end -%>
<%- end -%>
<%- if proxy['reverse_urls'].nil? -%>
ProxyPassReverse <%= proxy['url'] %>
<%- else -%>
<%- Array(proxy['reverse_urls']).each do |reverse_url| -%>
ProxyPassReverse <%= reverse_url %>
<%- end -%>
<%- end -%>
<%- if proxy['setenv'] -%>
<%- Array(proxy['setenv']).each do |setenv_var| -%>
SetEnv <%= setenv_var %>
<%- end -%>
<%- end -%>
<% end -%>
<%- end -%>
<%- if directory['custom_fragment'] -%>
<%= directory['custom_fragment'] %>
<%- end -%>
Expand Down

0 comments on commit 594d115

Please sign in to comment.