reverseproxy_ynh/conf/nginx.conf
selfhoster1312 c7b5b3dbee Handle edgecases gracefully
Yunohost templating doesn't like @__NAME____proxy because `reverseproxy__2__proxy` will evaluate __2__ to $2
or @__NAME__@proxy because ynh_replace_vars uses @ as sed delimiter
and ynh_replace_vars really hates multiline blocks... Using actual newlines in string produces a sed unclosed delimiter error,
while using \n gets them double escaped to some weird output that crashed nginx.
2023-01-10 13:12:50 +01:00

26 lines
753 B
Nginx Configuration File

location @__NAME__--proxy {
proxy_pass __PROXY_PATH__;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Port $server_port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
more_clear_input_headers 'Accept-Encoding';
}
# Support relative URLs
__REDIRECT_BLOCK__
location __PATH_URL_SLASH__ {
alias __ASSETS_PATH__;
try_files $uri @__NAME__--proxy;
}