Skip to content

Commit

Permalink
fix: disable absolute redirects
Browse files Browse the repository at this point in the history
nginx will automatically redirect to paths with a trailing slash it
is missing. But this lead to issues where nginx would redirect from
HTTPS back to HTTP if it's running behind a proxy which already
terminates TLS. As a workaround we configure nginx to do relative
redirects that don't contain the scheme.
  • Loading branch information
ctrox committed Jan 30, 2024
1 parent 389451e commit dba1bf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ $(( end ))
# Specify files sent to client if specific file not requested (e.g.
# GET www.example.com/). NGINX sends first existing file in the list.
index index.html index.htm Default.htm;

# this fixes cases where nginx would redirect https://whatever/path to
# http://whatever/path/ when behind a TLS terminating proxy.
absolute_redirect off;
}

$((- if .LastModifiedValue ))
Expand Down

0 comments on commit dba1bf6

Please sign in to comment.