mirror of
https://github.com/chatmail/relay.git
synced 2026-10-24 14:54:14 +00:00
fix(nginx): don't leak internal port 8443 in directory redirects
nginx listens on 127.0.0.1:8443 behind the stream proxy on port 443. For a directory requested without a trailing slash, nginx built an absolute Location header with its own port, e.g. https://example.org:8443/apps/, which is unreachable from outside. With absolute_redirect off, nginx sends a relative Location: /apps/.
This commit is contained in:
@@ -68,6 +68,11 @@ http {
|
||||
|
||||
listen 127.0.0.1:8443 ssl default_server;
|
||||
|
||||
# nginx is reached through the stream proxy on port 443,
|
||||
# so redirects it generates itself (e.g. /dir -> /dir/)
|
||||
# must not contain the internal port 8443.
|
||||
absolute_redirect off;
|
||||
|
||||
root {{ www_root }};
|
||||
|
||||
index index.html index.htm;
|
||||
|
||||
Reference in New Issue
Block a user