[GH-ISSUE #4631] Nginx - Login looping back to login page #2941

Closed
opened 2026-02-22 18:31:57 -05:00 by yindo · 3 comments
Owner

Originally created by @eudemocracystiftung on GitHub (Nov 7, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4631

How are you running AnythingLLM?

Docker (remote machine)

What happened?

Hi,
We have AnythingLLM deployed via Docker on a VPS. We are able to start the container and, using an Nginx reverse proxy, to have a password-protected HTTPS access, at serge.edcstiftung.eu. Test credentials are login: test password: test.
However, once we get to the login page and enter the right password (edcstiftung), the page just reloads and asks again for the password.
This seems like it is more an issue with the AnythingLLM config in Nginx than with AnythingLLM itself, but surely someone has experience on this.
Below is the Nginx config file:

server {
    if ($host = serge.edcstiftung.eu) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
   
    listen 80;
    server_name serge.edcstiftung.eu;
    return 404; # managed by Certbot

    # We'll start with HTTP and let Certbot modify this later

    location / {

        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
       
        # WebSocket support (needed for some ChangeDetection features)
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Timeouts for long-running connections
        proxy_read_timeout 86400;
        proxy_send_timeout 86400;
    }
}
server {
    listen 443 ssl;
    listen [::]:443 ssl;
    server_name serge.edcstiftung.eu;
    ssl_certificate /etc/letsencrypt/live/serge.edcstiftung.eu/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/serge.edcstiftung.eu/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
   
    location / {
        auth_basic "Restricted Content";
        auth_basic_user_file /etc/nginx/.htpasswd;
       
        proxy_pass http://localhost:3001;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
       
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_read_timeout 86400;
        proxy_send_timeout 86400;
    }
}

Are there known steps to reproduce?

No response

Originally created by @eudemocracystiftung on GitHub (Nov 7, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4631 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? Hi, We have AnythingLLM deployed via Docker on a VPS. We are able to start the container and, using an Nginx reverse proxy, to have a password-protected HTTPS access, at [serge.edcstiftung.eu](https://serge.edcstiftung.eu). Test credentials are login: test password: test. However, once we get to the login page and enter the right password (edcstiftung), the page just reloads and asks again for the password. This seems like it is more an issue with the AnythingLLM config in Nginx than with AnythingLLM itself, but surely someone has experience on this. Below is the Nginx config file: ``` server { if ($host = serge.edcstiftung.eu) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; server_name serge.edcstiftung.eu; return 404; # managed by Certbot # We'll start with HTTP and let Certbot modify this later location / { proxy_pass http://localhost:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # WebSocket support (needed for some ChangeDetection features) proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # Timeouts for long-running connections proxy_read_timeout 86400; proxy_send_timeout 86400; } } server { listen 443 ssl; listen [::]:443 ssl; server_name serge.edcstiftung.eu; ssl_certificate /etc/letsencrypt/live/serge.edcstiftung.eu/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/serge.edcstiftung.eu/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { auth_basic "Restricted Content"; auth_basic_user_file /etc/nginx/.htpasswd; proxy_pass http://localhost:3001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 86400; proxy_send_timeout 86400; } } ``` ### Are there known steps to reproduce? _No response_
yindo added the possible bugneeds info / can't replicate labels 2026-02-22 18:31:57 -05:00
yindo closed this issue 2026-02-22 18:31:57 -05:00
Author
Owner

@timothycarambat commented on GitHub (Nov 12, 2025):

Does this happen in an incognito tab?

@timothycarambat commented on GitHub (Nov 12, 2025): Does this happen in an incognito tab?
Author
Owner

@eudemocracystiftung commented on GitHub (Nov 12, 2025):

Are you asking hypothetically, @timothycarambat ? At least, in my own, I am not using incognito tabs. I do use Firefox's Enhanced Tracking Protection, but that has not changed compared to before using Nginx.

Should we leave this open until it is resolved?

@eudemocracystiftung commented on GitHub (Nov 12, 2025): Are you asking hypothetically, @timothycarambat ? At least, in my own, I am not using incognito tabs. I do use Firefox's Enhanced Tracking Protection, but that has not changed compared to before using Nginx. Should we leave this open until it is resolved?
Author
Owner

@eudemocracystiftung commented on GitHub (Nov 19, 2025):

Hi @timothycarambat, is it possible to re-open this issue?

@eudemocracystiftung commented on GitHub (Nov 19, 2025): Hi @timothycarambat, is it possible to re-open this issue?
yindo changed title from Nginx - Login looping back to login page to [GH-ISSUE #4631] Nginx - Login looping back to login page 2026-06-05 14:49:24 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2941