From 8bb7d27588706eb20f68c3103883b2f58b016754 Mon Sep 17 00:00:00 2001 From: Thomas Nixon Date: Fri, 23 May 2025 19:53:15 +0100 Subject: [PATCH] doc/manual: correct nginx reverse proxy example - hydra does not remove the base URI from the request before processing it, so this must be done in the reverse proxy. in nginx this is done by giving proxy_pass a URI rather than a protocol/host/port; see: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass - proxy_redirect is not correct/required: hydra uses proxy headers to correctly form redirects in most cases, and where it doesn't it produces local redirects which aren't matched by this directive anyway --- doc/manual/src/configuration.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/manual/src/configuration.md b/doc/manual/src/configuration.md index d370312a..856d314c 100644 --- a/doc/manual/src/configuration.md +++ b/doc/manual/src/configuration.md @@ -63,8 +63,7 @@ following: .. other configuration .. location /hydra/ { - proxy_pass http://127.0.0.1:3000; - proxy_redirect http://127.0.0.1:3000 https://example.com/hydra; + proxy_pass http://127.0.0.1:3000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -74,6 +73,9 @@ following: } } +Note the trailing slash on the `proxy_pass` directive, which causes nginx to +strip off the `/hydra/` part of the URL before passing it to hydra. + Populating a Cache ------------------