Infinite Redirect

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
CormoranTick
Newbie
Newbie
Posts: 6
Joined: March 14th, 2023, 9:19 am

Infinite Redirect

Post by CormoranTick »

I'm getting an infinite redirect loop.

I have sabnzbd 4.4.1 running on port 8080 with HTTPs enabled. I have an nginx reverse proxy on the same network segment. Through the reverse proxy I can access the login page and successfully login (i.e. a session cookie is generated) and it redirects me to /. It then immediately redirects me to /login/ and then back to / etc.etc. until my browser stops it.

I am able to login directly via port 8080 without issue. Additionally, if I browse to the reverse proxy domain directly after logging in, it also works sometimes, though will randomly start redirecting as I move through the interface.

Something appears to be broken through the reverse proxy. In my logs I only see that the requests seem to be jumping between IPv4 and IPv6, but I forced the reverse proxy to use only one and the issue still showed up.

Any suggestions?

# Log files
aaaa:aaaa:aaaa::aaaa is the sanitized nginx IPv6 address
cccc:cccc:cccc::cccc is the sanitized client IPv6 address

Code: Select all

Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,615::DEBUG::[interface:144] Request GET /login/ from aaaa:aaaa:aaaa::aaaa (X-Forwarded-For: cccc:cccc:cccc::cccc)
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,615::DEBUG::[interface:403] Request GET /login/ redirected to /
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,683::DEBUG::[interface:144] Request GET / from ::ffff:10.0.0.123 (X-Forwarded-For: cccc:cccc:cccc::cccc)
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,683::DEBUG::[interface:403] Request GET / redirected to /login/
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,769::DEBUG::[interface:144] Request GET /login/ from aaaa:aaaa:aaaa::aaaa (X-Forwarded-For: cccc:cccc:cccc::cccc)
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,769::DEBUG::[interface:403] Request GET /login/ redirected to /
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,831::DEBUG::[interface:144] Request GET / from ::ffff:10.0.0.123 (X-Forwarded-For: cccc:cccc:cccc::cccc)
Feb 04 17:27:18 dl python3[363203]: 2025-02-04 17:27:18,832::DEBUG::[interface:403] Request GET / redirected to /login/
# nginx config

Code: Select all

    client_max_body_size 10m;
    client_body_buffer_size 128k;

    #Timeout if the real server is dead
    proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

    # Advanced Proxy Config
    send_timeout 5m;
    proxy_read_timeout 240;
    proxy_send_timeout 240;
    proxy_connect_timeout 240;

    # Basic Proxy Config
    include /etc/nginx/proxy_params;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect  http://  $scheme://;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_cache_bypass $cookie_session;
    proxy_no_cache $cookie_session;
    proxy_buffers 32 4k;

    location / {
        proxy_pass https://<domain>:8080/;
    }
CormoranTick
Newbie
Newbie
Posts: 6
Joined: March 14th, 2023, 9:19 am

Re: Infinite Redirect

Post by CormoranTick »

It was because of the IP flapping.

Forcing the reverse proxy to call the upstream on either either IPv4 or IPv6 only, resolves the issue. However I don't have this problem with any other application behind the proxy, so I still this it might be a SAB bug.
User avatar
sander
Release Testers
Release Testers
Posts: 9216
Joined: January 22nd, 2008, 2:22 pm

Re: Infinite Redirect

Post by sander »

CormoranTick
Newbie
Newbie
Posts: 6
Joined: March 14th, 2023, 9:19 am

Re: Infinite Redirect

Post by CormoranTick »

sander wrote: February 5th, 2025, 1:01 am your post too https://github.com/sabnzbd/sabnzbd/issues/3028 ?
Yeah. Wasn't sure which was more appropriate to post for this, form or github. I closed the github issue though, because it's probably not a bug, and if it is it seems more and more liekly that it's an nginx thing not sab.

Still boggling my mind why it won't just pick an IP. ???

Oh well.
Post Reply