From 390f69858c7c54a39a098a38401db636283ea453 Mon Sep 17 00:00:00 2001 From: Adam French Date: Mon, 13 Apr 2026 11:55:42 +0100 Subject: [PATCH] Redirect to original URL after admin login Pass the requested URI as ?redirect= when nginx denies access, so the login page can forward the user to their intended destination on success. Co-Authored-By: Claude Sonnet 4.6 --- nginx/nginx.conf.template | 2 +- nginx/nginx_dev.conf.template | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index 03d5b8a..daa7ff9 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -246,7 +246,7 @@ http { } location @auth_denied { - return 302 /admin/login; + return 302 /admin/login?redirect=$request_uri; } location /searxng { diff --git a/nginx/nginx_dev.conf.template b/nginx/nginx_dev.conf.template index 5762ccf..fcd448b 100644 --- a/nginx/nginx_dev.conf.template +++ b/nginx/nginx_dev.conf.template @@ -173,7 +173,7 @@ http { } location @auth_denied { - return 302 /; + return 302 /admin/login?redirect=$request_uri; } location /searxng { @@ -329,7 +329,7 @@ http { } location @auth_denied { - return 302 /; + return 302 /admin/login?redirect=$request_uri; } location /searxng {