public inbox for [email protected]  
help / color / mirror / Atom feed
From: Shakir Idrisi <[email protected]>
To: Yogesh Mahajan <[email protected]>
Cc: [email protected]
Cc: [email protected]
Subject: Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
Date: Tue, 10 Jun 2025 15:53:38 +0530
Message-ID: <CAKZfs-rJF=D5JBfcuRpYLrYQTmbHJ9eGJf4ShDzbp34Wq7ewVA@mail.gmail.com> (raw)
In-Reply-To: <CAMa=N=PgeekhtrE+bJn2atLui8sqqSDxdD3ScqSCMws+WenjOQ@mail.gmail.com>
References: <CAKZfs-q0xwvyL5mQ5-Q5cMSzK0bHa03VjeNRzyCBVze-fa_CeQ@mail.gmail.com>
	<CAMa=N=PgeekhtrE+bJn2atLui8sqqSDxdD3ScqSCMws+WenjOQ@mail.gmail.com>

HI,

I have used this command, and I have created a systemd file to start and
stop the service.

*ExecStart=/var/w-data/pgadmin4/pgadmin_venv/bin/gunicorn \*
*    --workers 1 \*
* --threads=25 \*
*    --bind unix:/tmp/pgadmin4.sock \*
*    --chdir
/var/w-data/pgadmin4/pgadmin_venv/lib/python3.11/site-packages/pgadmin4 \*
* --umask 007 \*
*    pgAdmin4:app*

Also, when I try multiple times then it will log in and show a blank
dashboard, or sometimes it will show a dashboard but not work properly. In
the console log, I see the following error

[image: image.png]

On Tue, Jun 10, 2025 at 3:26 PM Yogesh Mahajan <
[email protected]> wrote:

> Hi,
>
> Can you please share your guicorn command?
> How many workers are you spawning? It should be 1.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Tue, Jun 10, 2025 at 12:34 PM Shakir Idrisi <[email protected]> wrote:
>
>> 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:
>>
>> *nginx*
>> location /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:
>>
>>    1.
>>
>>    Is there something wrong with the proxy setup?
>>    2.
>>
>>    Do I need to handle static assets or cookies differently when using a
>>    subpath (/pgadmin4)?
>>    3.
>>
>>    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.
>>
>


Attachments:

  [image/png] image.png (90.4K, 3-image.png)
  download | view image

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
  In-Reply-To: <CAKZfs-rJF=D5JBfcuRpYLrYQTmbHJ9eGJf4ShDzbp34Wq7ewVA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox