bundles/nginx: more config options

This commit is contained in:
Franzi 2024-10-26 08:19:43 +02:00
parent ed9607433d
commit a83b380490
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 3 additions and 6 deletions

View file

@ -10,9 +10,6 @@ events {
http {
include /etc/nginx/mime.types;
types {
application/javascript js mjs;
}
default_type application/octet-stream;
charset UTF-8;
override_charset on;

View file

@ -149,18 +149,18 @@ server {
% if 'target' in options:
proxy_pass ${options['target']};
proxy_http_version ${options.get('http_version', '1.1')};
proxy_set_header Host ${domain};
proxy_set_header Host ${options.get('proxy_pass_host', domain)};
% 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;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host ${options.get('x_forwarded_host', domain)};
proxy_set_header X-Forwarded-Host ${options.get('x_forwarded_host', options.get('proxy_pass_host', domain))};
% for option, value in options.get('proxy_set_header', {}).items():
proxy_set_header ${option} ${value};
% endfor
% if location != '/':
% if location != '/' and location != '= /':
proxy_set_header X-Script-Name ${location};
% endif
proxy_buffering off;