Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
| От | Shakir Idrisi |
|---|---|
| Тема | Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path |
| Дата | |
| Msg-id | CAKZfs-q0xwvyL5mQ5-Q5cMSzK0bHa03VjeNRzyCBVze-fa_CeQ@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
|
| Список | pgadmin-support |
Hi,
I've installed pgAdmin 4 on my Linux server and configured it behind Gunicorn and NGINX, accessible at:https://domain.com/pgadmin4/.
The login page loads correctly. However, after entering valid credentials, I'm redirected back to the login page without any error message. Occasionally, I see a CSRF token error, which disappears after a page refresh, but the login still fails.
In the browser console or network tab, I sometimes see 401 errors or issues loading static assets.
Here's the NGINX configuration I'm currently using to reverse proxy pgAdmin via a Unix socket:
nginxlocation /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock:/; # Proxy headers 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; # Inform pgAdmin it's served under a subpath proxy_set_header X-Script-Name /pgadmin4; # Optional: timeouts and static asset handling proxy_read_timeout 300; proxy_connect_timeout 60; }
Could you please advise:
Is there something wrong with the proxy setup?
Do I need to handle static assets or cookies differently when using a subpath (
/pgadmin4)?Are there any additional settings required in the pgAdmin config to work correctly behind a sub-URI with NGINX?
Thanks in advance for your guidance.
В списке pgadmin-support по дате отправления: