docs: Fix the nginx rewrite

With the previous nginx configuration, all requests that matched
`$badagent` were rewrote to `/ai`, without the original URL anywhere.
This resulted in `iocaine` only seeing `/ai`, and thus, every page ended
up being rendered the same.

The rewrite should take the original request URI into account, which is
what this patch does.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
This commit is contained in:
Gergely Nagy 2025-01-29 07:44:34 +01:00
parent f486b99984
commit ea9972dbfc
No known key found for this signature in database

View file

@ -39,7 +39,7 @@ Within the `server` block, we'll rewrite the URL if find a match on `$badagent`,
server {
server_name blog.example.com;
if ($badagent) {
rewrite ^ /ai;
rewrite ^ /ai$request_uri;
}
location /ai {
proxy_set_header Host $host;