bundles/nginx: proxy is a dict now, add some more configuration options
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
d1672a9a45
commit
7ea85247e0
4 changed files with 39 additions and 10 deletions
|
@ -36,16 +36,26 @@ server {
|
|||
}
|
||||
|
||||
% if proxy:
|
||||
% for location, proxy_pass in proxy.items():
|
||||
% for location, options in proxy.items():
|
||||
location ${location} {
|
||||
proxy_pass ${proxy_pass};
|
||||
proxy_pass ${options['target']};
|
||||
proxy_http_version ${options.get('http_version', '1.1')};
|
||||
proxy_set_header Host ${domain};
|
||||
proxy_set_header X-Script-Name /;
|
||||
% if options.get('websockets', False):
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
% endif
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
% if node.metadata['nginx']['use_ssl_for_all_connections']:
|
||||
proxy_set_header X-Forwarded-Proto HTTPS;
|
||||
% endif
|
||||
proxy_set_header X-Forwarded-Host ${domain};
|
||||
% for option, value in options.get('proxy_set_header', {}).items():
|
||||
proxy_set_header ${option} ${value};
|
||||
% endfor
|
||||
% if location != '/':
|
||||
proxy_set_header X-Script-Name ${location};
|
||||
% endif
|
||||
proxy_buffering off;
|
||||
}
|
||||
% endfor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue