public inbox for [email protected]
help / color / mirror / Atom feedIssue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
26+ messages / 3 participants
[nested] [flat]
* Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
@ 2025-06-10 07:04 Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-06-10 07:04 UTC (permalink / raw)
To: [email protected]; [email protected]
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.
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-06-10 09:55 ` Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-06-10 09:55 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: [email protected]; [email protected]
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.
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-06-10 10:23 ` Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-06-10 10:23 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: [email protected]; [email protected]
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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-06-10 11:56 ` Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-06-10 11:56 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: [email protected]
Hi,
I could reproduce the error when I have multiple workers. Maybe you can try
restarting the Guicorn service.
Can you please try once in the private browser window?
Thanks,
Yogesh Mahajan
EnterpriseDB
On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]> wrote:
> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-06-16 04:25 ` Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-06-16 04:25 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
You can use the command 'update-user' for user update.
To explore more options, you can use the command below with pgadmin venv.
`python3.12 setup.py update-user --help `
Typical command would be -
`python3.12 setup.py update-user <user_id> --password <new_password> --role
Administrator --sqlite-path <pgadmin_db_path>`
Thanks,
Yogesh Mahajan
EnterpriseDB
On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I hope you're doing well.
>
> pgAdmin is now working properly. Earlier, I ran the setup-db command and
> set the admin username and password.
>
> Now, after reinstalling pgAdmin, I noticed that the data directory
> (including pgadmin.db) was not removed. I would like to either reuse the
> old admin password or reset it if needed.
>
> Is there a way to reset the admin user's password using a command in this
> case?
> Your guidance would be greatly appreciated.
>
> Thank you for your help.
>
> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]> wrote:
>
>> Ok, I will check.
>>
>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> I could reproduce the error when I have multiple workers. Maybe you can
>>> try restarting the Guicorn service.
>>> Can you please try once in the private browser window?
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-06-20 06:08 ` Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-06-20 06:08 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Thanks, it worked.
I am facing an issue when I try to access the pgadmin of https after
logging in; it shows a blank page. Can you please help me figure it out?
This is the config I am using for the proxy in HTTPS and HTTP vhblock
*location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
/pgadmin4; proxy_http_version 1.1; proxy_read_timeout 300;
proxy_connect_timeout 60;}*
In the browser console of I am getting this error.
*Object { message: "Request failed with status code 401", name:
"AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
XMLHttpRequest, response: {…}, status: 401, stack: "".....*
On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> You can use the command 'update-user' for user update.
>
> To explore more options, you can use the command below with pgadmin venv.
>
>
> `python3.12 setup.py update-user --help `
>
>
>
> Typical command would be -
>
>
> `python3.12 setup.py update-user <user_id> --password <new_password>
> --role Administrator --sqlite-path <pgadmin_db_path>`
>
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> I hope you're doing well.
>>
>> pgAdmin is now working properly. Earlier, I ran the setup-db command and
>> set the admin username and password.
>>
>> Now, after reinstalling pgAdmin, I noticed that the data directory
>> (including pgadmin.db) was not removed. I would like to either reuse the
>> old admin password or reset it if needed.
>>
>> Is there a way to reset the admin user's password using a command in this
>> case?
>> Your guidance would be greatly appreciated.
>>
>> Thank you for your help.
>>
>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Ok, I will check.
>>>
>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I could reproduce the error when I have multiple workers. Maybe you can
>>>> try restarting the Guicorn service.
>>>> Can you please try once in the private browser window?
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-06-20 07:54 ` Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-06-20 07:54 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
One more question, can I use autologin in pgAdmin4? I am using the internal
method for authentication.
On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> Thanks, it worked.
>
> I am facing an issue when I try to access the pgadmin of https after
> logging in; it shows a blank page. Can you please help me figure it out?
>
> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
> /pgadmin4; proxy_http_version 1.1; proxy_read_timeout 300;
> proxy_connect_timeout 60;}*
>
> In the browser console of I am getting this error.
> *Object { message: "Request failed with status code 401", name:
> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>
> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> You can use the command 'update-user' for user update.
>>
>> To explore more options, you can use the command below with pgadmin venv.
>>
>>
>> `python3.12 setup.py update-user --help `
>>
>>
>>
>> Typical command would be -
>>
>>
>> `python3.12 setup.py update-user <user_id> --password <new_password>
>> --role Administrator --sqlite-path <pgadmin_db_path>`
>>
>>
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I hope you're doing well.
>>>
>>> pgAdmin is now working properly. Earlier, I ran the setup-db command and
>>> set the admin username and password.
>>>
>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>> old admin password or reset it if needed.
>>>
>>> Is there a way to reset the admin user's password using a command in
>>> this case?
>>> Your guidance would be greatly appreciated.
>>>
>>> Thank you for your help.
>>>
>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Ok, I will check.
>>>>
>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I could reproduce the error when I have multiple workers. Maybe you
>>>>> can try restarting the Guicorn service.
>>>>> Can you please try once in the private browser window?
>>>>>
>>>>> Thanks,
>>>>> Yogesh Mahajan
>>>>> EnterpriseDB
>>>>>
>>>>>
>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-06-23 03:42 ` Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-06-23 03:42 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Can you please try modifying '/pgadmin4' like below -
`location = /pgadmin4 {
return 301 /pgadmin4/;
}`
You can use webserver /kerberos authentication method for automatic login.
With internal authentication method, you will required to enter your
userid/password. You may also use OAuth2.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> One more question, can I use autologin in pgAdmin4? I am using the
> internal method for authentication.
>
> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> Thanks, it worked.
>>
>> I am facing an issue when I try to access the pgadmin of https after
>> logging in; it shows a blank page. Can you please help me figure it out?
>>
>> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
>> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>> proxy_set_header X-Script-Name /pgadmin4; proxy_http_version 1.1;
>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>
>> In the browser console of I am getting this error.
>> *Object { message: "Request failed with status code 401", name:
>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>
>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> You can use the command 'update-user' for user update.
>>>
>>> To explore more options, you can use the command below with pgadmin venv.
>>>
>>>
>>> `python3.12 setup.py update-user --help `
>>>
>>>
>>>
>>> Typical command would be -
>>>
>>>
>>> `python3.12 setup.py update-user <user_id> --password <new_password>
>>> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>
>>>
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I hope you're doing well.
>>>>
>>>> pgAdmin is now working properly. Earlier, I ran the setup-db command
>>>> and set the admin username and password.
>>>>
>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>> old admin password or reset it if needed.
>>>>
>>>> Is there a way to reset the admin user's password using a command in
>>>> this case?
>>>> Your guidance would be greatly appreciated.
>>>>
>>>> Thank you for your help.
>>>>
>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]> wrote:
>>>>
>>>>> Ok, I will check.
>>>>>
>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I could reproduce the error when I have multiple workers. Maybe you
>>>>>> can try restarting the Guicorn service.
>>>>>> Can you please try once in the private browser window?
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-07-31 13:57 ` Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-07-31 13:57 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I am facing an issue when I try to access the pgadmin of https after
logging in; it shows a blank page. Can you please help me figure it out?
This is the config I am using.
*location = /pgadmin4 { return 301 /pgadmin4/;}*
*location ^~ /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
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_set_header X-Forwarded-Host $host;proxy_set_header
X-Script-Name /pgadmin4;proxy_http_version 1.1; proxy_read_timeout 300;
proxy_connect_timeout 60;}*
In the browser console of I am getting this error.
*Object { message: "Request failed with status code
401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…},
request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> Can you please try modifying '/pgadmin4' like below -
> `location = /pgadmin4 {
> return 301 /pgadmin4/;
> }`
>
> You can use webserver /kerberos authentication method for automatic login.
> With internal authentication method, you will required to enter your
> userid/password. You may also use OAuth2.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> One more question, can I use autologin in pgAdmin4? I am using the
>> internal method for authentication.
>>
>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Thanks, it worked.
>>>
>>> I am facing an issue when I try to access the pgadmin of https after
>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>
>>> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
>>> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>> proxy_set_header X-Script-Name /pgadmin4; proxy_http_version 1.1;
>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>
>>> In the browser console of I am getting this error.
>>> *Object { message: "Request failed with status code 401", name:
>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>
>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> You can use the command 'update-user' for user update.
>>>>
>>>> To explore more options, you can use the command below with pgadmin
>>>> venv.
>>>>
>>>>
>>>> `python3.12 setup.py update-user --help `
>>>>
>>>>
>>>>
>>>> Typical command would be -
>>>>
>>>>
>>>> `python3.12 setup.py update-user <user_id> --password <new_password>
>>>> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>
>>>>
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I hope you're doing well.
>>>>>
>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db command
>>>>> and set the admin username and password.
>>>>>
>>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>>> old admin password or reset it if needed.
>>>>>
>>>>> Is there a way to reset the admin user's password using a command in
>>>>> this case?
>>>>> Your guidance would be greatly appreciated.
>>>>>
>>>>> Thank you for your help.
>>>>>
>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]> wrote:
>>>>>
>>>>>> Ok, I will check.
>>>>>>
>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I could reproduce the error when I have multiple workers. Maybe you
>>>>>>> can try restarting the Guicorn service.
>>>>>>> Can you please try once in the private browser window?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Yogesh Mahajan
>>>>>>> EnterpriseDB
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-03 16:51 ` Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-03 16:51 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Any update on this?
On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I am facing an issue when I try to access the pgadmin of https after
> logging in; it shows a blank page. Can you please help me figure it out?
>
> This is the config I am using.
>
>
>
> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>
>
>
>
>
>
>
>
>
>
>
>
>
> *location ^~ /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
> 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_set_header X-Forwarded-Host $host;proxy_set_header
> X-Script-Name /pgadmin4;proxy_http_version 1.1; proxy_read_timeout 300;
> proxy_connect_timeout 60;}*
>
> In the browser console of I am getting this error.
> *Object { message: "Request failed with status code
> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>
> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> Can you please try modifying '/pgadmin4' like below -
>> `location = /pgadmin4 {
>> return 301 /pgadmin4/;
>> }`
>>
>> You can use webserver /kerberos authentication method for automatic
>> login. With internal authentication method, you will required to enter your
>> userid/password. You may also use OAuth2.
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> One more question, can I use autologin in pgAdmin4? I am using the
>>> internal method for authentication.
>>>
>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Thanks, it worked.
>>>>
>>>> I am facing an issue when I try to access the pgadmin of https after
>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>
>>>> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/
>>>> { proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>>> proxy_set_header X-Script-Name /pgadmin4; proxy_http_version 1.1;
>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>
>>>> In the browser console of I am getting this error.
>>>> *Object { message: "Request failed with status code 401", name:
>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>
>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> You can use the command 'update-user' for user update.
>>>>>
>>>>> To explore more options, you can use the command below with pgadmin
>>>>> venv.
>>>>>
>>>>>
>>>>> `python3.12 setup.py update-user --help `
>>>>>
>>>>>
>>>>>
>>>>> Typical command would be -
>>>>>
>>>>>
>>>>> `python3.12 setup.py update-user <user_id> --password <new_password>
>>>>> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Yogesh Mahajan
>>>>> EnterpriseDB
>>>>>
>>>>>
>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I hope you're doing well.
>>>>>>
>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db command
>>>>>> and set the admin username and password.
>>>>>>
>>>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>>>> old admin password or reset it if needed.
>>>>>>
>>>>>> Is there a way to reset the admin user's password using a command in
>>>>>> this case?
>>>>>> Your guidance would be greatly appreciated.
>>>>>>
>>>>>> Thank you for your help.
>>>>>>
>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Ok, I will check.
>>>>>>>
>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I could reproduce the error when I have multiple workers. Maybe you
>>>>>>>> can try restarting the Guicorn service.
>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Yogesh Mahajan
>>>>>>>> EnterpriseDB
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-04 05:08 ` Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-08-04 05:08 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Can you please try changing proxy_pass to
proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
As you are setting the script name. If it does not work, please paste the
complete configuration for nginx, and service file to debug more.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> Any update on this?
>
> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> I am facing an issue when I try to access the pgadmin of https after
>> logging in; it shows a blank page. Can you please help me figure it out?
>>
>> This is the config I am using.
>>
>>
>>
>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *location ^~ /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>> 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_set_header X-Forwarded-Host $host;proxy_set_header
>> X-Script-Name /pgadmin4;proxy_http_version 1.1; proxy_read_timeout 300;
>> proxy_connect_timeout 60;}*
>>
>> In the browser console of I am getting this error.
>> *Object { message: "Request failed with status code
>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>
>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> Can you please try modifying '/pgadmin4' like below -
>>> `location = /pgadmin4 {
>>> return 301 /pgadmin4/;
>>> }`
>>>
>>> You can use webserver /kerberos authentication method for automatic
>>> login. With internal authentication method, you will required to enter your
>>> userid/password. You may also use OAuth2.
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>> internal method for authentication.
>>>>
>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks, it worked.
>>>>>
>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>
>>>>> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/
>>>>> { proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>>>> proxy_set_header X-Script-Name /pgadmin4; proxy_http_version 1.1;
>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>
>>>>> In the browser console of I am getting this error.
>>>>> *Object { message: "Request failed with status code 401", name:
>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>
>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> You can use the command 'update-user' for user update.
>>>>>>
>>>>>> To explore more options, you can use the command below with pgadmin
>>>>>> venv.
>>>>>>
>>>>>>
>>>>>> `python3.12 setup.py update-user --help `
>>>>>>
>>>>>>
>>>>>>
>>>>>> Typical command would be -
>>>>>>
>>>>>>
>>>>>> `python3.12 setup.py update-user <user_id> --password <new_password>
>>>>>> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I hope you're doing well.
>>>>>>>
>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db command
>>>>>>> and set the admin username and password.
>>>>>>>
>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>>>>> old admin password or reset it if needed.
>>>>>>>
>>>>>>> Is there a way to reset the admin user's password using a command in
>>>>>>> this case?
>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>
>>>>>>> Thank you for your help.
>>>>>>>
>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Ok, I will check.
>>>>>>>>
>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I could reproduce the error when I have multiple workers. Maybe
>>>>>>>>> you can try restarting the Guicorn service.
>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Yogesh Mahajan
>>>>>>>>> EnterpriseDB
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> 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
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-08-04 07:01 ` Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-04 07:01 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I have tried the above solution, but it is still not working.
I have monitored the log, and it shows that the user is logged in.
*2025-08-04 12:23:33,777: INFO pgadmin: Internal user
[email protected] <[email protected]> logged in.*
However, after logging in, the page appears blank.
In the browser’s *Network tab*, most requests return *200*, but about *3
requests return 401 Unauthorized*.
[image: image.png]
conf I'm using, this works when accessed on http, but when I access it on
https, it shows a blank page,
certificate is installed on the domain.
*location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
/pgadmin4/; proxy_http_version 1.1; proxy_read_timeout 300;
proxy_connect_timeout 60;}*
On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> Can you please try changing proxy_pass to
>
> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>
> As you are setting the script name. If it does not work, please paste the
> complete configuration for nginx, and service file to debug more.
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> Any update on this?
>>
>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am facing an issue when I try to access the pgadmin of https after
>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>
>>> This is the config I am using.
>>>
>>>
>>>
>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *location ^~ /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>> 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_set_header X-Forwarded-Host $host;proxy_set_header
>>> X-Script-Name /pgadmin4;proxy_http_version 1.1; proxy_read_timeout 300;
>>> proxy_connect_timeout 60;}*
>>>
>>> In the browser console of I am getting this error.
>>> *Object { message: "Request failed with status code
>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>
>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Can you please try modifying '/pgadmin4' like below -
>>>> `location = /pgadmin4 {
>>>> return 301 /pgadmin4/;
>>>> }`
>>>>
>>>> You can use webserver /kerberos authentication method for automatic
>>>> login. With internal authentication method, you will required to enter your
>>>> userid/password. You may also use OAuth2.
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>>> internal method for authentication.
>>>>>
>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Thanks, it worked.
>>>>>>
>>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>>
>>>>>> This is the config I am using for the proxy in HTTPS and HTTP vhblock
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/
>>>>>> { proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>>>>> proxy_set_header X-Script-Name /pgadmin4; proxy_http_version 1.1;
>>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>>
>>>>>> In the browser console of I am getting this error.
>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>
>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>
>>>>>>> To explore more options, you can use the command below with pgadmin
>>>>>>> venv.
>>>>>>>
>>>>>>>
>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Typical command would be -
>>>>>>>
>>>>>>>
>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Yogesh Mahajan
>>>>>>> EnterpriseDB
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I hope you're doing well.
>>>>>>>>
>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>> command and set the admin username and password.
>>>>>>>>
>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>>>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>>>>>> old admin password or reset it if needed.
>>>>>>>>
>>>>>>>> Is there a way to reset the admin user's password using a command
>>>>>>>> in this case?
>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>
>>>>>>>> Thank you for your help.
>>>>>>>>
>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Ok, I will check.
>>>>>>>>>
>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I could reproduce the error when I have multiple workers. Maybe
>>>>>>>>>> you can try restarting the Guicorn service.
>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>> EnterpriseDB
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-04 07:16 ` Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-08-04 07:16 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
So the issue is with SSL. I guess this has to do with the nginx
configuration, not the pgadmin one.
Generic redirection for non-SSL to SSL should look as below -
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.key;
........
location /pgadmin4/ {
proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
.........
}
}
Thanks,
Yogesh Mahajan
EnterpriseDB
On Mon, Aug 4, 2025 at 12:31 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I have tried the above solution, but it is still not working.
> I have monitored the log, and it shows that the user is logged in.
> *2025-08-04 12:23:33,777: INFO pgadmin: Internal user
> [email protected] <[email protected]> logged in.*
>
> However, after logging in, the page appears blank.
>
> In the browser’s *Network tab*, most requests return *200*, but about *3
> requests return 401 Unauthorized*.
> [image: image.png]
>
>
> conf I'm using, this works when accessed on http, but when I access it on
> https, it shows a blank page,
> certificate is installed on the domain.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
> /pgadmin4/; proxy_http_version 1.1; proxy_read_timeout 300;
> proxy_connect_timeout 60;}*
>
> On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> Can you please try changing proxy_pass to
>>
>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>
>> As you are setting the script name. If it does not work, please paste the
>> complete configuration for nginx, and service file to debug more.
>>
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Any update on this?
>>>
>>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am facing an issue when I try to access the pgadmin of https after
>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>
>>>> This is the config I am using.
>>>>
>>>>
>>>>
>>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *location ^~ /pgadmin4/ { proxy_pass
>>>> http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host
>>>> $host;proxy_set_header X-Script-Name /pgadmin4;proxy_http_version 1.1;
>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>
>>>> In the browser console of I am getting this error.
>>>> *Object { message: "Request failed with status code
>>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>
>>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Can you please try modifying '/pgadmin4' like below -
>>>>> `location = /pgadmin4 {
>>>>> return 301 /pgadmin4/;
>>>>> }`
>>>>>
>>>>> You can use webserver /kerberos authentication method for automatic
>>>>> login. With internal authentication method, you will required to enter your
>>>>> userid/password. You may also use OAuth2.
>>>>>
>>>>> Thanks,
>>>>> Yogesh Mahajan
>>>>> EnterpriseDB
>>>>>
>>>>>
>>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>>>> internal method for authentication.
>>>>>>
>>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Thanks, it worked.
>>>>>>>
>>>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>>>
>>>>>>> This is the config I am using for the proxy in HTTPS and HTTP
>>>>>>> vhblock
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~
>>>>>>> /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>>>> 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_set_header
>>>>>>> X-Forwarded-Host $host; proxy_set_header X-Script-Name /pgadmin4;
>>>>>>> proxy_http_version 1.1; proxy_read_timeout 300; proxy_connect_timeout
>>>>>>> 60;}*
>>>>>>>
>>>>>>> In the browser console of I am getting this error.
>>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>
>>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>>
>>>>>>>> To explore more options, you can use the command below with pgadmin
>>>>>>>> venv.
>>>>>>>>
>>>>>>>>
>>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Typical command would be -
>>>>>>>>
>>>>>>>>
>>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Yogesh Mahajan
>>>>>>>> EnterpriseDB
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I hope you're doing well.
>>>>>>>>>
>>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>>> command and set the admin username and password.
>>>>>>>>>
>>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data directory
>>>>>>>>> (including pgadmin.db) was not removed. I would like to either reuse the
>>>>>>>>> old admin password or reset it if needed.
>>>>>>>>>
>>>>>>>>> Is there a way to reset the admin user's password using a command
>>>>>>>>> in this case?
>>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>>
>>>>>>>>> Thank you for your help.
>>>>>>>>>
>>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Ok, I will check.
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I could reproduce the error when I have multiple workers. Maybe
>>>>>>>>>>> you can try restarting the Guicorn service.
>>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <[email protected]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-08-04 07:32 ` Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-04 07:32 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
HI,
When I access the URL, it will load the SSL certificate properly on the
domain, but why do three requests get a 401 error?
Any idea?
On Mon, Aug 4, 2025 at 12:46 PM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> So the issue is with SSL. I guess this has to do with the nginx
> configuration, not the pgadmin one.
> Generic redirection for non-SSL to SSL should look as below -
>
> server {
> listen 80;
> return 301 https://$host$request_uri;
> }
>
> server {
> listen 443 ssl;
> server_name _;
> ssl_certificate /etc/nginx/server.crt;
> ssl_certificate_key /etc/nginx/server.key;
> ........
>
> location /pgadmin4/ {
> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>
> .........
>
>
> }
> }
>
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Mon, Aug 4, 2025 at 12:31 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> I have tried the above solution, but it is still not working.
>> I have monitored the log, and it shows that the user is logged in.
>> *2025-08-04 12:23:33,777: INFO pgadmin: Internal user
>> [email protected] <[email protected]> logged in.*
>>
>> However, after logging in, the page appears blank.
>>
>> In the browser’s *Network tab*, most requests return *200*, but about *3
>> requests return 401 Unauthorized*.
>> [image: image.png]
>>
>>
>> conf I'm using, this works when accessed on http, but when I access it on
>> https, it shows a blank page,
>> certificate is installed on the domain.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
>> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>> proxy_set_header X-Script-Name /pgadmin4/; proxy_http_version 1.1;
>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>
>> On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> Can you please try changing proxy_pass to
>>>
>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>
>>> As you are setting the script name. If it does not work, please paste
>>> the complete configuration for nginx, and service file to debug more.
>>>
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Any update on this?
>>>>
>>>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>
>>>>> This is the config I am using.
>>>>>
>>>>>
>>>>>
>>>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *location ^~ /pgadmin4/ { proxy_pass
>>>>> http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host
>>>>> $host;proxy_set_header X-Script-Name /pgadmin4;proxy_http_version 1.1;
>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>
>>>>> In the browser console of I am getting this error.
>>>>> *Object { message: "Request failed with status code
>>>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>
>>>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Can you please try modifying '/pgadmin4' like below -
>>>>>> `location = /pgadmin4 {
>>>>>> return 301 /pgadmin4/;
>>>>>> }`
>>>>>>
>>>>>> You can use webserver /kerberos authentication method for automatic
>>>>>> login. With internal authentication method, you will required to enter your
>>>>>> userid/password. You may also use OAuth2.
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>>>>> internal method for authentication.
>>>>>>>
>>>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Thanks, it worked.
>>>>>>>>
>>>>>>>> I am facing an issue when I try to access the pgadmin of https
>>>>>>>> after logging in; it shows a blank page. Can you please help me figure it
>>>>>>>> out?
>>>>>>>>
>>>>>>>> This is the config I am using for the proxy in HTTPS and HTTP
>>>>>>>> vhblock
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~
>>>>>>>> /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>>>>> 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_set_header
>>>>>>>> X-Forwarded-Host $host; proxy_set_header X-Script-Name /pgadmin4;
>>>>>>>> proxy_http_version 1.1; proxy_read_timeout 300; proxy_connect_timeout
>>>>>>>> 60;}*
>>>>>>>>
>>>>>>>> In the browser console of I am getting this error.
>>>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>>
>>>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>>>
>>>>>>>>> To explore more options, you can use the command below with
>>>>>>>>> pgadmin venv.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Typical command would be -
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Yogesh Mahajan
>>>>>>>>> EnterpriseDB
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I hope you're doing well.
>>>>>>>>>>
>>>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>>>> command and set the admin username and password.
>>>>>>>>>>
>>>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data
>>>>>>>>>> directory (including pgadmin.db) was not removed. I would like to either
>>>>>>>>>> reuse the old admin password or reset it if needed.
>>>>>>>>>>
>>>>>>>>>> Is there a way to reset the admin user's password using a command
>>>>>>>>>> in this case?
>>>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>>>
>>>>>>>>>> Thank you for your help.
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Ok, I will check.
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I could reproduce the error when I have multiple workers. Maybe
>>>>>>>>>>>> you can try restarting the Guicorn service.
>>>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <
>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-04 08:05 ` Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-08-04 08:05 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Typical reason for the 401 while redirection from Non-SSL to SSL is
because the authentication credentials (like cookies, tokens, or headers)
are not preserved correctly.
Unless you provide your configuration, its difficult to help further.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Mon, Aug 4, 2025 at 1:02 PM Shakir Idrisi <[email protected]> wrote:
> HI,
>
> When I access the URL, it will load the SSL certificate properly on the
> domain, but why do three requests get a 401 error?
>
> Any idea?
>
>
>
> On Mon, Aug 4, 2025 at 12:46 PM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> So the issue is with SSL. I guess this has to do with the nginx
>> configuration, not the pgadmin one.
>> Generic redirection for non-SSL to SSL should look as below -
>>
>> server {
>> listen 80;
>> return 301 https://$host$request_uri;
>> }
>>
>> server {
>> listen 443 ssl;
>> server_name _;
>> ssl_certificate /etc/nginx/server.crt;
>> ssl_certificate_key /etc/nginx/server.key;
>> ........
>>
>> location /pgadmin4/ {
>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>
>> .........
>>
>>
>> }
>> }
>>
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Mon, Aug 4, 2025 at 12:31 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I have tried the above solution, but it is still not working.
>>> I have monitored the log, and it shows that the user is logged in.
>>> *2025-08-04 12:23:33,777: INFO pgadmin: Internal user
>>> [email protected] <[email protected]> logged in.*
>>>
>>> However, after logging in, the page appears blank.
>>>
>>> In the browser’s *Network tab*, most requests return *200*, but about *3
>>> requests return 401 Unauthorized*.
>>> [image: image.png]
>>>
>>>
>>> conf I'm using, this works when accessed on http, but when I access it
>>> on https, it shows a blank page,
>>> certificate is installed on the domain.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
>>> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>> proxy_set_header X-Script-Name /pgadmin4/; proxy_http_version 1.1;
>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>
>>> On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Can you please try changing proxy_pass to
>>>>
>>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>>
>>>> As you are setting the script name. If it does not work, please paste
>>>> the complete configuration for nginx, and service file to debug more.
>>>>
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Any update on this?
>>>>>
>>>>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>>
>>>>>> This is the config I am using.
>>>>>>
>>>>>>
>>>>>>
>>>>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *location ^~ /pgadmin4/ { proxy_pass
>>>>>> http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host
>>>>>> $host;proxy_set_header X-Script-Name /pgadmin4;proxy_http_version 1.1;
>>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>>
>>>>>> In the browser console of I am getting this error.
>>>>>> *Object { message: "Request failed with status code
>>>>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>
>>>>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Can you please try modifying '/pgadmin4' like below -
>>>>>>> `location = /pgadmin4 {
>>>>>>> return 301 /pgadmin4/;
>>>>>>> }`
>>>>>>>
>>>>>>> You can use webserver /kerberos authentication method for automatic
>>>>>>> login. With internal authentication method, you will required to enter your
>>>>>>> userid/password. You may also use OAuth2.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Yogesh Mahajan
>>>>>>> EnterpriseDB
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>>>>>> internal method for authentication.
>>>>>>>>
>>>>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Thanks, it worked.
>>>>>>>>>
>>>>>>>>> I am facing an issue when I try to access the pgadmin of https
>>>>>>>>> after logging in; it shows a blank page. Can you please help me figure it
>>>>>>>>> out?
>>>>>>>>>
>>>>>>>>> This is the config I am using for the proxy in HTTPS and HTTP
>>>>>>>>> vhblock
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~
>>>>>>>>> /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>>>>>> 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_set_header
>>>>>>>>> X-Forwarded-Host $host; proxy_set_header X-Script-Name /pgadmin4;
>>>>>>>>> proxy_http_version 1.1; proxy_read_timeout 300; proxy_connect_timeout
>>>>>>>>> 60;}*
>>>>>>>>>
>>>>>>>>> In the browser console of I am getting this error.
>>>>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>>>
>>>>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>>>>
>>>>>>>>>> To explore more options, you can use the command below with
>>>>>>>>>> pgadmin venv.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Typical command would be -
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>> EnterpriseDB
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I hope you're doing well.
>>>>>>>>>>>
>>>>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>>>>> command and set the admin username and password.
>>>>>>>>>>>
>>>>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data
>>>>>>>>>>> directory (including pgadmin.db) was not removed. I would like to either
>>>>>>>>>>> reuse the old admin password or reset it if needed.
>>>>>>>>>>>
>>>>>>>>>>> Is there a way to reset the admin user's password using a
>>>>>>>>>>> command in this case?
>>>>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>>>>
>>>>>>>>>>> Thank you for your help.
>>>>>>>>>>>
>>>>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Ok, I will check.
>>>>>>>>>>>>
>>>>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I could reproduce the error when I have multiple workers.
>>>>>>>>>>>>> Maybe you can try restarting the Guicorn service.
>>>>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <
>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-08-04 09:45 ` Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-04 09:45 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I have shared my nginx.conf, please help me to debug this.
Nginx.conf
*server { listen 2005 ssl; listen 2004; include
/usr/local/web_app/conf/web_app/test/admin_port*; server_name localhost;
ssl_certificate /var/web_app/certs/web_app-combined.pem;
ssl_certificate_key /var/web_app/certs/web_app.key; ssl_session_timeout
5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; # The Document Root root
/usr/local/web_app/web/admin; rewrite "/sess([0-9a-zA-Z]{16})/(.*)" /$2; #
Redirect server error pages to the static pages error_page 404
/nginx/404.html; error_page 497 /nginx/497.html; error_page 500 502 503
504 /nginx/50x.html; # For proxy from user domains set $web_app_https '';
set $web_app_port ''; set $web_app_real_ip ''; include
/usr/local/web_app/conf/web_app/test/admin_proxy_security*; # Any other
locations include
/usr/local/web_app/conf/web_app/test/admin_locations_pgadmin4.conf; # Pass
the INDEX.PHP OR PHP script OR "/" to FastCGI location ~
^(/index.php|install.php|/filemanager/elfinder.php|/)$ { fastcgi_pass
unix:/usr/local/test/var/fpm-root.sock; fastcgi_read_timeout 3600;
fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME
$fastcgi_script_name; include fastcgi_params; } # Pass the regular PHP
scripts to test FastCGI location ~ \.php$ { fastcgi_pass
unix:/usr/local/test/var/fpm-web_app.sock; fastcgi_read_timeout 3600;
fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME
$fastcgi_script_name; include fastcgi_params; } # TTY / User Shell include
/usr/local/web_app/conf/web_app/test/ttyd.conf; # Custom conf if any !
include /usr/local/test/etc/nginx/conf.d/*;}*Above is my nginx.conf and in
my nginx.conf I have included admin_location_pgadmin4.conf.
This is the conf saved under the file admin_location_pgadmin4.conf
*location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
/pgadmin4/; proxy_http_version 1.1; proxy_read_timeout 300;
proxy_connect_timeout 60;}*When I access domain:2004/pgadmin4 then it works.
But when I access it on SSL port using domain:2005 or IP:2005, it will show
a blank page after login.
On Mon, Aug 4, 2025 at 1:35 PM Yogesh Mahajan <
[email protected]> wrote:
> Hi,
>
> Typical reason for the 401 while redirection from Non-SSL to SSL is
> because the authentication credentials (like cookies, tokens, or headers)
> are not preserved correctly.
> Unless you provide your configuration, its difficult to help further.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Mon, Aug 4, 2025 at 1:02 PM Shakir Idrisi <[email protected]> wrote:
>
>> HI,
>>
>> When I access the URL, it will load the SSL certificate properly on the
>> domain, but why do three requests get a 401 error?
>>
>> Any idea?
>>
>>
>>
>> On Mon, Aug 4, 2025 at 12:46 PM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> So the issue is with SSL. I guess this has to do with the nginx
>>> configuration, not the pgadmin one.
>>> Generic redirection for non-SSL to SSL should look as below -
>>>
>>> server {
>>> listen 80;
>>> return 301 https://$host$request_uri;
>>> }
>>>
>>> server {
>>> listen 443 ssl;
>>> server_name _;
>>> ssl_certificate /etc/nginx/server.crt;
>>> ssl_certificate_key /etc/nginx/server.key;
>>> ........
>>>
>>> location /pgadmin4/ {
>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>
>>> .........
>>>
>>>
>>> }
>>> }
>>>
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Mon, Aug 4, 2025 at 12:31 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have tried the above solution, but it is still not working.
>>>> I have monitored the log, and it shows that the user is logged in.
>>>> *2025-08-04 12:23:33,777: INFO pgadmin: Internal user
>>>> [email protected] <[email protected]> logged in.*
>>>>
>>>> However, after logging in, the page appears blank.
>>>>
>>>> In the browser’s *Network tab*, most requests return *200*, but about *3
>>>> requests return 401 Unauthorized*.
>>>> [image: image.png]
>>>>
>>>>
>>>> conf I'm using, this works when accessed on http, but when I access it
>>>> on https, it shows a blank page,
>>>> certificate is installed on the domain.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/
>>>> { proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>>> proxy_set_header X-Script-Name /pgadmin4/; proxy_http_version 1.1;
>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>
>>>> On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Can you please try changing proxy_pass to
>>>>>
>>>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>>>
>>>>> As you are setting the script name. If it does not work, please paste
>>>>> the complete configuration for nginx, and service file to debug more.
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Yogesh Mahajan
>>>>> EnterpriseDB
>>>>>
>>>>>
>>>>> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Any update on this?
>>>>>>
>>>>>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am facing an issue when I try to access the pgadmin of https after
>>>>>>> logging in; it shows a blank page. Can you please help me figure it out?
>>>>>>>
>>>>>>> This is the config I am using.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *location ^~ /pgadmin4/ { proxy_pass
>>>>>>> http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host
>>>>>>> $host;proxy_set_header X-Script-Name /pgadmin4;proxy_http_version 1.1;
>>>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>>>
>>>>>>> In the browser console of I am getting this error.
>>>>>>> *Object { message: "Request failed with status code
>>>>>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>
>>>>>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Can you please try modifying '/pgadmin4' like below -
>>>>>>>> `location = /pgadmin4 {
>>>>>>>> return 301 /pgadmin4/;
>>>>>>>> }`
>>>>>>>>
>>>>>>>> You can use webserver /kerberos authentication method for automatic
>>>>>>>> login. With internal authentication method, you will required to enter your
>>>>>>>> userid/password. You may also use OAuth2.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Yogesh Mahajan
>>>>>>>> EnterpriseDB
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> One more question, can I use autologin in pgAdmin4? I am using the
>>>>>>>>> internal method for authentication.
>>>>>>>>>
>>>>>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Thanks, it worked.
>>>>>>>>>>
>>>>>>>>>> I am facing an issue when I try to access the pgadmin of https
>>>>>>>>>> after logging in; it shows a blank page. Can you please help me figure it
>>>>>>>>>> out?
>>>>>>>>>>
>>>>>>>>>> This is the config I am using for the proxy in HTTPS and HTTP
>>>>>>>>>> vhblock
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~
>>>>>>>>>> /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>>>>>>> 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_set_header
>>>>>>>>>> X-Forwarded-Host $host; proxy_set_header X-Script-Name /pgadmin4;
>>>>>>>>>> proxy_http_version 1.1; proxy_read_timeout 300; proxy_connect_timeout
>>>>>>>>>> 60;}*
>>>>>>>>>>
>>>>>>>>>> In the browser console of I am getting this error.
>>>>>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>>>>
>>>>>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>>>>>
>>>>>>>>>>> To explore more options, you can use the command below with
>>>>>>>>>>> pgadmin venv.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Typical command would be -
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <[email protected]>
>>>>>>>>>>> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I hope you're doing well.
>>>>>>>>>>>>
>>>>>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>>>>>> command and set the admin username and password.
>>>>>>>>>>>>
>>>>>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data
>>>>>>>>>>>> directory (including pgadmin.db) was not removed. I would like to either
>>>>>>>>>>>> reuse the old admin password or reset it if needed.
>>>>>>>>>>>>
>>>>>>>>>>>> Is there a way to reset the admin user's password using a
>>>>>>>>>>>> command in this case?
>>>>>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>>>>>
>>>>>>>>>>>> Thank you for your help.
>>>>>>>>>>>>
>>>>>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Ok, I will check.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I could reproduce the error when I have multiple workers.
>>>>>>>>>>>>>> Maybe you can try restarting the Guicorn service.
>>>>>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <
>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-04 10:55 ` Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-08-04 10:55 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Try a couple of changes below -
proxy_pass http://unix:/tmp/pgadmin4.sock:/pgadmin4/; (You have missed
/pgadmin4/ here)
proxy_set_header X-Script-Name /pgadmin4; (you added extra '/' - here)
Thanks,
Yogesh Mahajan
EnterpriseDB
On Mon, Aug 4, 2025 at 3:15 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I have shared my nginx.conf, please help me to debug this.
> Nginx.conf
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *server { listen 2005 ssl; listen 2004; include
> /usr/local/web_app/conf/web_app/test/admin_port*; server_name localhost;
> ssl_certificate /var/web_app/certs/web_app-combined.pem;
> ssl_certificate_key /var/web_app/certs/web_app.key; ssl_session_timeout
> 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5;
> ssl_prefer_server_ciphers on; # The Document Root root
> /usr/local/web_app/web/admin; rewrite "/sess([0-9a-zA-Z]{16})/(.*)" /$2; #
> Redirect server error pages to the static pages error_page 404
> /nginx/404.html; error_page 497 /nginx/497.html; error_page 500 502 503
> 504 /nginx/50x.html; # For proxy from user domains set $web_app_https '';
> set $web_app_port ''; set $web_app_real_ip ''; include
> /usr/local/web_app/conf/web_app/test/admin_proxy_security*; # Any other
> locations include
> /usr/local/web_app/conf/web_app/test/admin_locations_pgadmin4.conf; # Pass
> the INDEX.PHP OR PHP script OR "/" to FastCGI location ~
> ^(/index.php|install.php|/filemanager/elfinder.php|/)$ { fastcgi_pass
> unix:/usr/local/test/var/fpm-root.sock; fastcgi_read_timeout 3600;
> fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME
> $fastcgi_script_name; include fastcgi_params; } # Pass the regular PHP
> scripts to test FastCGI location ~ \.php$ { fastcgi_pass
> unix:/usr/local/test/var/fpm-web_app.sock; fastcgi_read_timeout 3600;
> fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME
> $fastcgi_script_name; include fastcgi_params; } # TTY / User Shell include
> /usr/local/web_app/conf/web_app/test/ttyd.conf; # Custom conf if any !
> include /usr/local/test/etc/nginx/conf.d/*;}*Above is my nginx.conf and
> in my nginx.conf I have included admin_location_pgadmin4.conf.
> This is the conf saved under the file admin_location_pgadmin4.conf
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/ {
> proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host; proxy_set_header X-Script-Name
> /pgadmin4/; proxy_http_version 1.1; proxy_read_timeout 300;
> proxy_connect_timeout 60;}*When I access domain:2004/pgadmin4 then it
> works.
> But when I access it on SSL port using domain:2005 or IP:2005, it will
> show a blank page after login.
>
>
> On Mon, Aug 4, 2025 at 1:35 PM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> Typical reason for the 401 while redirection from Non-SSL to SSL is
>> because the authentication credentials (like cookies, tokens, or headers)
>> are not preserved correctly.
>> Unless you provide your configuration, its difficult to help further.
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Mon, Aug 4, 2025 at 1:02 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> HI,
>>>
>>> When I access the URL, it will load the SSL certificate properly on the
>>> domain, but why do three requests get a 401 error?
>>>
>>> Any idea?
>>>
>>>
>>>
>>> On Mon, Aug 4, 2025 at 12:46 PM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> So the issue is with SSL. I guess this has to do with the nginx
>>>> configuration, not the pgadmin one.
>>>> Generic redirection for non-SSL to SSL should look as below -
>>>>
>>>> server {
>>>> listen 80;
>>>> return 301 https://$host$request_uri;
>>>> }
>>>>
>>>> server {
>>>> listen 443 ssl;
>>>> server_name _;
>>>> ssl_certificate /etc/nginx/server.crt;
>>>> ssl_certificate_key /etc/nginx/server.key;
>>>> ........
>>>>
>>>> location /pgadmin4/ {
>>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>>
>>>> .........
>>>>
>>>>
>>>> }
>>>> }
>>>>
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Mon, Aug 4, 2025 at 12:31 PM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have tried the above solution, but it is still not working.
>>>>> I have monitored the log, and it shows that the user is logged in.
>>>>> *2025-08-04 12:23:33,777: INFO pgadmin: Internal user
>>>>> [email protected] <[email protected]> logged in.*
>>>>>
>>>>> However, after logging in, the page appears blank.
>>>>>
>>>>> In the browser’s *Network tab*, most requests return *200*, but about *3
>>>>> requests return 401 Unauthorized*.
>>>>> [image: image.png]
>>>>>
>>>>>
>>>>> conf I'm using, this works when accessed on http, but when I access it
>>>>> on https, it shows a blank page,
>>>>> certificate is installed on the domain.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~ /pgadmin4/
>>>>> { proxy_pass http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host $host;
>>>>> proxy_set_header X-Script-Name /pgadmin4/; proxy_http_version 1.1;
>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>
>>>>> On Mon, Aug 4, 2025 at 10:38 AM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Can you please try changing proxy_pass to
>>>>>>
>>>>>> proxy_pass http://unix:/tmp/pgadmin4.sock:/<scripnt_name>/;
>>>>>>
>>>>>> As you are setting the script name. If it does not work, please paste
>>>>>> the complete configuration for nginx, and service file to debug more.
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Sun, Aug 3, 2025 at 10:21 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Any update on this?
>>>>>>>
>>>>>>> On Thu, Jul 31, 2025, 7:27 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am facing an issue when I try to access the pgadmin of https
>>>>>>>> after logging in; it shows a blank page. Can you please help me figure it
>>>>>>>> out?
>>>>>>>>
>>>>>>>> This is the config I am using.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *location = /pgadmin4 { return 301 /pgadmin4/;}*
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> *location ^~ /pgadmin4/ { proxy_pass
>>>>>>>> http://unix:/tmp/pgadmin4.sock; 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_set_header X-Forwarded-Host
>>>>>>>> $host;proxy_set_header X-Script-Name /pgadmin4;proxy_http_version 1.1;
>>>>>>>> proxy_read_timeout 300; proxy_connect_timeout 60;}*
>>>>>>>>
>>>>>>>> In the browser console of I am getting this error.
>>>>>>>> *Object { message: "Request failed with status code
>>>>>>>> 401", name: "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request: XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>>
>>>>>>>> On Mon, Jun 23, 2025 at 9:12 AM Yogesh Mahajan <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Can you please try modifying '/pgadmin4' like below -
>>>>>>>>> `location = /pgadmin4 {
>>>>>>>>> return 301 /pgadmin4/;
>>>>>>>>> }`
>>>>>>>>>
>>>>>>>>> You can use webserver /kerberos authentication method for
>>>>>>>>> automatic login. With internal authentication method, you will required to
>>>>>>>>> enter your userid/password. You may also use OAuth2.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Yogesh Mahajan
>>>>>>>>> EnterpriseDB
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Fri, Jun 20, 2025 at 1:24 PM Shakir Idrisi <[email protected]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> One more question, can I use autologin in pgAdmin4? I am using
>>>>>>>>>> the internal method for authentication.
>>>>>>>>>>
>>>>>>>>>> On Fri, Jun 20, 2025 at 11:38 AM Shakir Idrisi <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Thanks, it worked.
>>>>>>>>>>>
>>>>>>>>>>> I am facing an issue when I try to access the pgadmin of https
>>>>>>>>>>> after logging in; it shows a blank page. Can you please help me figure it
>>>>>>>>>>> out?
>>>>>>>>>>>
>>>>>>>>>>> This is the config I am using for the proxy in HTTPS and HTTP
>>>>>>>>>>> vhblock
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *location = /pgadmin4 { rewrite ^ /pgadmin4/; }location ^~
>>>>>>>>>>> /pgadmin4/ { proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>>>>>>>> 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_set_header
>>>>>>>>>>> X-Forwarded-Host $host; proxy_set_header X-Script-Name /pgadmin4;
>>>>>>>>>>> proxy_http_version 1.1; proxy_read_timeout 300; proxy_connect_timeout
>>>>>>>>>>> 60;}*
>>>>>>>>>>>
>>>>>>>>>>> In the browser console of I am getting this error.
>>>>>>>>>>> *Object { message: "Request failed with status code 401", name:
>>>>>>>>>>> "AxiosError", code: "ERR_BAD_REQUEST", config: {…}, request:
>>>>>>>>>>> XMLHttpRequest, response: {…}, status: 401, stack: "".....*
>>>>>>>>>>>
>>>>>>>>>>> On Mon, Jun 16, 2025 at 9:56 AM Yogesh Mahajan <
>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> You can use the command 'update-user' for user update.
>>>>>>>>>>>>
>>>>>>>>>>>> To explore more options, you can use the command below with
>>>>>>>>>>>> pgadmin venv.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> `python3.12 setup.py update-user --help `
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Typical command would be -
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> `python3.12 setup.py update-user <user_id> --password
>>>>>>>>>>>> <new_password> --role Administrator --sqlite-path <pgadmin_db_path>`
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks,
>>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Sat, Jun 14, 2025 at 5:09 PM Shakir Idrisi <
>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I hope you're doing well.
>>>>>>>>>>>>>
>>>>>>>>>>>>> pgAdmin is now working properly. Earlier, I ran the setup-db
>>>>>>>>>>>>> command and set the admin username and password.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Now, after reinstalling pgAdmin, I noticed that the data
>>>>>>>>>>>>> directory (including pgadmin.db) was not removed. I would like to either
>>>>>>>>>>>>> reuse the old admin password or reset it if needed.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is there a way to reset the admin user's password using a
>>>>>>>>>>>>> command in this case?
>>>>>>>>>>>>> Your guidance would be greatly appreciated.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thank you for your help.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Jun 10, 2025, 9:57 PM Shakir Idrisi <[email protected]>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Ok, I will check.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Tue, Jun 10, 2025, 5:26 PM Yogesh Mahajan <
>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I could reproduce the error when I have multiple workers.
>>>>>>>>>>>>>>> Maybe you can try restarting the Guicorn service.
>>>>>>>>>>>>>>> Can you please try once in the private browser window?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>> Yogesh Mahajan
>>>>>>>>>>>>>>> EnterpriseDB
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Tue, Jun 10, 2025 at 3:54 PM Shakir Idrisi <
>>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 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
[image/png] image.png (122.4K, 4-image.png)
download | view image
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-08-04 11:04 ` Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-04 11:04 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I’ve tried the suggested changes, but I’m still encountering the same issue
— a blank page appears after logging in over HTTPS.
As a workaround, I modified the config_local.py file and set:
*WTF_CSRF_CHECK_DEFAULT = False*
With this change, pgAdmin works correctly on HTTPS. However, I understand
that disabling CSRF protection is not recommended in a production
environment, so I’m looking for a more secure solution.
Here’s a snippet of my current *config_local.py* for reference:
DATA_DIR = '/var/lib/pgadmin4'
SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
STORAGE_DIR = '/var/lib/pgadmin4/storage'
AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
SCRIPT_NAME = '/pgadmin4'
LOG_LEVEL = 'DEBUG'
CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40, CRITICAL = 50
FILE_LOG_LEVEL = 20
LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
Could you please help me identify the correct settings to securely enable
CSRF protection while ensuring pgAdmin functions properly over both HTTP
and HTTPS under /pgadmin4?
>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-05 04:22 ` Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Yogesh Mahajan @ 2025-08-05 04:22 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I have already provided the nginx configuration. Have you tried it? Issues
is clearly with Nginx config.
Thanks,
Yogesh Mahajan
EnterpriseDB
On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
> I’ve tried the suggested changes, but I’m still encountering the same
> issue — a blank page appears after logging in over HTTPS.
>
> As a workaround, I modified the config_local.py file and set:
> *WTF_CSRF_CHECK_DEFAULT = False*
>
> With this change, pgAdmin works correctly on HTTPS. However, I understand
> that disabling CSRF protection is not recommended in a production
> environment, so I’m looking for a more secure solution.
>
> Here’s a snippet of my current *config_local.py* for reference:
>
> DATA_DIR = '/var/lib/pgadmin4'
> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
> STORAGE_DIR = '/var/lib/pgadmin4/storage'
> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>
> SCRIPT_NAME = '/pgadmin4'
>
> LOG_LEVEL = 'DEBUG'
> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40, CRITICAL =
> 50
> FILE_LOG_LEVEL = 20
> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>
> Could you please help me identify the correct settings to securely enable
> CSRF protection while ensuring pgAdmin functions properly over both HTTP
> and HTTPS under /pgadmin4?
>
>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
@ 2025-08-05 04:53 ` Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-05 04:53 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Yes I have tried that conf which you have provided.
I have mentioned that in my last reply that it is not working.
Still getting blank page after login on https.
On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <[email protected]>
wrote:
> Hi,
>
> I have already provided the nginx configuration. Have you tried it? Issues
> is clearly with Nginx config.
>
> Thanks,
> Yogesh Mahajan
> EnterpriseDB
>
>
> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>> I’ve tried the suggested changes, but I’m still encountering the same
>> issue — a blank page appears after logging in over HTTPS.
>>
>> As a workaround, I modified the config_local.py file and set:
>> *WTF_CSRF_CHECK_DEFAULT = False*
>>
>> With this change, pgAdmin works correctly on HTTPS. However, I understand
>> that disabling CSRF protection is not recommended in a production
>> environment, so I’m looking for a more secure solution.
>>
>> Here’s a snippet of my current *config_local.py* for reference:
>>
>> DATA_DIR = '/var/lib/pgadmin4'
>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>
>> SCRIPT_NAME = '/pgadmin4'
>>
>> LOG_LEVEL = 'DEBUG'
>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40, CRITICAL =
>> 50
>> FILE_LOG_LEVEL = 20
>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>
>> Could you please help me identify the correct settings to securely enable
>> CSRF protection while ensuring pgAdmin functions properly over both HTTP
>> and HTTPS under /pgadmin4?
>>
>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-05 09:25 ` Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-05 09:25 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Do you have any updates or suggestions that could help me further debug
this issue?
On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> Yes I have tried that conf which you have provided.
> I have mentioned that in my last reply that it is not working.
> Still getting blank page after login on https.
>
> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
> [email protected]> wrote:
>
>> Hi,
>>
>> I have already provided the nginx configuration. Have you tried it?
>> Issues is clearly with Nginx config.
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>> I’ve tried the suggested changes, but I’m still encountering the same
>>> issue — a blank page appears after logging in over HTTPS.
>>>
>>> As a workaround, I modified the config_local.py file and set:
>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>
>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>> understand that disabling CSRF protection is not recommended in a
>>> production environment, so I’m looking for a more secure solution.
>>>
>>> Here’s a snippet of my current *config_local.py* for reference:
>>>
>>> DATA_DIR = '/var/lib/pgadmin4'
>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>
>>> SCRIPT_NAME = '/pgadmin4'
>>>
>>> LOG_LEVEL = 'DEBUG'
>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40, CRITICAL
>>> = 50
>>> FILE_LOG_LEVEL = 20
>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>
>>> Could you please help me identify the correct settings to securely
>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>> HTTP and HTTPS under /pgadmin4?
>>>
>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-05 11:27 ` Shakir Idrisi <[email protected]>
2025-08-06 05:26 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-05 11:27 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I updated the configuration and it's now working.
I'm using it *$http_host* instead of *$host* for the *Host *header.
Just want to confirm — is this the correct and recommended way?
location ^~ /pgadmin4/ {
>
> proxy_pass http://unix:/tmp/pgadmin4.sock;
> proxy_set_header Host $http_host; # here i have changed $host to
> $http_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_set_header X-Forwarded-Host $host;
> proxy_set_header X-Script-Name /pgadmin4;
> proxy_http_version 1.1;
>
>
> proxy_read_timeout 300;
> proxy_connect_timeout 60;
}
On Tue, Aug 5, 2025 at 2:55 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> Do you have any updates or suggestions that could help me further debug
> this issue?
>
> On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> Yes I have tried that conf which you have provided.
>> I have mentioned that in my last reply that it is not working.
>> Still getting blank page after login on https.
>>
>> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
>> [email protected]> wrote:
>>
>>> Hi,
>>>
>>> I have already provided the nginx configuration. Have you tried it?
>>> Issues is clearly with Nginx config.
>>>
>>> Thanks,
>>> Yogesh Mahajan
>>> EnterpriseDB
>>>
>>>
>>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>> I’ve tried the suggested changes, but I’m still encountering the same
>>>> issue — a blank page appears after logging in over HTTPS.
>>>>
>>>> As a workaround, I modified the config_local.py file and set:
>>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>>
>>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>>> understand that disabling CSRF protection is not recommended in a
>>>> production environment, so I’m looking for a more secure solution.
>>>>
>>>> Here’s a snippet of my current *config_local.py* for reference:
>>>>
>>>> DATA_DIR = '/var/lib/pgadmin4'
>>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>>
>>>> SCRIPT_NAME = '/pgadmin4'
>>>>
>>>> LOG_LEVEL = 'DEBUG'
>>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40, CRITICAL
>>>> = 50
>>>> FILE_LOG_LEVEL = 20
>>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>>
>>>> Could you please help me identify the correct settings to securely
>>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>>> HTTP and HTTPS under /pgadmin4?
>>>>
>>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-06 05:26 ` Shakir Idrisi <[email protected]>
2025-08-06 05:30 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Khushboo Vashi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-06 05:26 UTC (permalink / raw)
To: Yogesh Mahajan <[email protected]>; +Cc: pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Apologies for the interruption. May I kindly ask if the configuration I
provided in my previous reply is correct?
On Tue, Aug 5, 2025 at 4:57 PM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I updated the configuration and it's now working.
> I'm using it *$http_host* instead of *$host* for the *Host *header.
> Just want to confirm — is this the correct and recommended way?
>
> location ^~ /pgadmin4/ {
>>
>> proxy_pass http://unix:/tmp/pgadmin4.sock;
>> proxy_set_header Host $http_host; # here i have changed $host to
>> $http_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_set_header X-Forwarded-Host $host;
>> proxy_set_header X-Script-Name /pgadmin4;
>> proxy_http_version 1.1;
>>
>>
>> proxy_read_timeout 300;
>> proxy_connect_timeout 60;
>
> }
>
> On Tue, Aug 5, 2025 at 2:55 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> Do you have any updates or suggestions that could help me further debug
>> this issue?
>>
>> On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Yes I have tried that conf which you have provided.
>>> I have mentioned that in my last reply that it is not working.
>>> Still getting blank page after login on https.
>>>
>>> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I have already provided the nginx configuration. Have you tried it?
>>>> Issues is clearly with Nginx config.
>>>>
>>>> Thanks,
>>>> Yogesh Mahajan
>>>> EnterpriseDB
>>>>
>>>>
>>>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>> I’ve tried the suggested changes, but I’m still encountering the same
>>>>> issue — a blank page appears after logging in over HTTPS.
>>>>>
>>>>> As a workaround, I modified the config_local.py file and set:
>>>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>>>
>>>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>>>> understand that disabling CSRF protection is not recommended in a
>>>>> production environment, so I’m looking for a more secure solution.
>>>>>
>>>>> Here’s a snippet of my current *config_local.py* for reference:
>>>>>
>>>>> DATA_DIR = '/var/lib/pgadmin4'
>>>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>>>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>>>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>>>
>>>>> SCRIPT_NAME = '/pgadmin4'
>>>>>
>>>>> LOG_LEVEL = 'DEBUG'
>>>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40,
>>>>> CRITICAL = 50
>>>>> FILE_LOG_LEVEL = 20
>>>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>>>
>>>>> Could you please help me identify the correct settings to securely
>>>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>>>> HTTP and HTTPS under /pgadmin4?
>>>>>
>>>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-06 05:26 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-06 05:30 ` Khushboo Vashi <[email protected]>
2025-08-06 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Khushboo Vashi @ 2025-08-06 05:30 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: Yogesh Mahajan <[email protected]>; pgadmin-support lists.postgresql.org <[email protected]>
Hi,
Please refer
https://www.pgadmin.org/docs/pgadmin4/9.6/server_deployment.html#nginx-configuration-with-gunicorn
for nginx configuration.
On Wed, Aug 6, 2025 at 10:56 AM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> Apologies for the interruption. May I kindly ask if the configuration I
> provided in my previous reply is correct?
>
> On Tue, Aug 5, 2025 at 4:57 PM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> I updated the configuration and it's now working.
>> I'm using it *$http_host* instead of *$host* for the *Host *header.
>> Just want to confirm — is this the correct and recommended way?
>>
>> location ^~ /pgadmin4/ {
>>>
>>> proxy_pass http://unix:/tmp/pgadmin4.sock;
>>> proxy_set_header Host $http_host; # here i have changed $host to
>>> $http_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_set_header X-Forwarded-Host $host;
>>> proxy_set_header X-Script-Name /pgadmin4;
>>> proxy_http_version 1.1;
>>>
>>>
>>> proxy_read_timeout 300;
>>> proxy_connect_timeout 60;
>>
>> }
>>
>> On Tue, Aug 5, 2025 at 2:55 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Do you have any updates or suggestions that could help me further debug
>>> this issue?
>>>
>>> On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Yes I have tried that conf which you have provided.
>>>> I have mentioned that in my last reply that it is not working.
>>>> Still getting blank page after login on https.
>>>>
>>>> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have already provided the nginx configuration. Have you tried it?
>>>>> Issues is clearly with Nginx config.
>>>>>
>>>>> Thanks,
>>>>> Yogesh Mahajan
>>>>> EnterpriseDB
>>>>>
>>>>>
>>>>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>> I’ve tried the suggested changes, but I’m still encountering the same
>>>>>> issue — a blank page appears after logging in over HTTPS.
>>>>>>
>>>>>> As a workaround, I modified the config_local.py file and set:
>>>>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>>>>
>>>>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>>>>> understand that disabling CSRF protection is not recommended in a
>>>>>> production environment, so I’m looking for a more secure solution.
>>>>>>
>>>>>> Here’s a snippet of my current *config_local.py* for reference:
>>>>>>
>>>>>> DATA_DIR = '/var/lib/pgadmin4'
>>>>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>>>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>>>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>>>>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>>>>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>>>>
>>>>>> SCRIPT_NAME = '/pgadmin4'
>>>>>>
>>>>>> LOG_LEVEL = 'DEBUG'
>>>>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40,
>>>>>> CRITICAL = 50
>>>>>> FILE_LOG_LEVEL = 20
>>>>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>>>>
>>>>>> Could you please help me identify the correct settings to securely
>>>>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>>>>> HTTP and HTTPS under /pgadmin4?
>>>>>>
>>>>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-06 05:26 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-06 05:30 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Khushboo Vashi <[email protected]>
@ 2025-08-06 06:08 ` Shakir Idrisi <[email protected]>
2025-08-06 10:10 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Khushboo Vashi <[email protected]>
0 siblings, 1 reply; 26+ messages in thread
From: Shakir Idrisi @ 2025-08-06 06:08 UTC (permalink / raw)
To: Khushboo Vashi <[email protected]>; +Cc: Yogesh Mahajan <[email protected]>; pgadmin-support lists.postgresql.org <[email protected]>
Hi,
I referred to the documentation, but my Nginx setup doesn’t have the
proxy_params file. So I manually added the proxy_set_header lines. However,
after logging in, pgAdmin4 was showing a blank page.
*To fix it, I changed: proxy_set_header Host $host*;
*to: proxy_set_header Host $http_host;*
After this change, it began to work. I just want to confirm — is this the
correct approach, or is it working by chance due to a header mismatch?
On Wed, Aug 6, 2025 at 11:00 AM Khushboo Vashi <
[email protected]> wrote:
> Hi,
>
> Please refer
> https://www.pgadmin.org/docs/pgadmin4/9.6/server_deployment.html#nginx-configuration-with-gunicorn
> for nginx configuration.
>
>
> On Wed, Aug 6, 2025 at 10:56 AM Shakir Idrisi <[email protected]> wrote:
>
>> Hi,
>>
>> Apologies for the interruption. May I kindly ask if the configuration I
>> provided in my previous reply is correct?
>>
>> On Tue, Aug 5, 2025 at 4:57 PM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I updated the configuration and it's now working.
>>> I'm using it *$http_host* instead of *$host* for the *Host *header.
>>> Just want to confirm — is this the correct and recommended way?
>>>
>>> location ^~ /pgadmin4/ {
>>>>
>>>> proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>> proxy_set_header Host $http_host; # here i have changed $host to
>>>> $http_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_set_header X-Forwarded-Host $host;
>>>> proxy_set_header X-Script-Name /pgadmin4;
>>>> proxy_http_version 1.1;
>>>>
>>>>
>>>> proxy_read_timeout 300;
>>>> proxy_connect_timeout 60;
>>>
>>> }
>>>
>>> On Tue, Aug 5, 2025 at 2:55 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Do you have any updates or suggestions that could help me further debug
>>>> this issue?
>>>>
>>>> On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Yes I have tried that conf which you have provided.
>>>>> I have mentioned that in my last reply that it is not working.
>>>>> Still getting blank page after login on https.
>>>>>
>>>>> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have already provided the nginx configuration. Have you tried it?
>>>>>> Issues is clearly with Nginx config.
>>>>>>
>>>>>> Thanks,
>>>>>> Yogesh Mahajan
>>>>>> EnterpriseDB
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> I’ve tried the suggested changes, but I’m still encountering the
>>>>>>> same issue — a blank page appears after logging in over HTTPS.
>>>>>>>
>>>>>>> As a workaround, I modified the config_local.py file and set:
>>>>>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>>>>>
>>>>>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>>>>>> understand that disabling CSRF protection is not recommended in a
>>>>>>> production environment, so I’m looking for a more secure solution.
>>>>>>>
>>>>>>> Here’s a snippet of my current *config_local.py* for reference:
>>>>>>>
>>>>>>> DATA_DIR = '/var/lib/pgadmin4'
>>>>>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>>>>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>>>>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>>>>>> AZURE_CREDENTIAL_CACHE_DIR = '/var/lib/pgadmin4/azurecredentialcache'
>>>>>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>>>>>
>>>>>>> SCRIPT_NAME = '/pgadmin4'
>>>>>>>
>>>>>>> LOG_LEVEL = 'DEBUG'
>>>>>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40,
>>>>>>> CRITICAL = 50
>>>>>>> FILE_LOG_LEVEL = 20
>>>>>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>>>>>
>>>>>>> Could you please help me identify the correct settings to securely
>>>>>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>>>>>> HTTP and HTTPS under /pgadmin4?
>>>>>>>
>>>>>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
* Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-06 05:26 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-08-06 05:30 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Khushboo Vashi <[email protected]>
2025-08-06 06:08 ` Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
@ 2025-08-06 10:10 ` Khushboo Vashi <[email protected]>
0 siblings, 0 replies; 26+ messages in thread
From: Khushboo Vashi @ 2025-08-06 10:10 UTC (permalink / raw)
To: Shakir Idrisi <[email protected]>; +Cc: Yogesh Mahajan <[email protected]>; pgadmin-support lists.postgresql.org <[email protected]>
On Wed, Aug 6, 2025 at 11:38 AM Shakir Idrisi <[email protected]> wrote:
> Hi,
>
> I referred to the documentation, but my Nginx setup doesn’t have the
> proxy_params file. So I manually added the proxy_set_header lines. However,
> after logging in, pgAdmin4 was showing a blank page.
>
> *To fix it, I changed: proxy_set_header Host $host*;
> *to: proxy_set_header Host $http_host;*
>
> After this change, it began to work. I just want to confirm — is this the
> correct approach, or is it working by chance due to a header mismatch?
>
Both are different, and $host should be used. You can refer
https://stackoverflow.com/questions/39715510/nginx-when-to-use-proxy-set-header-host-host-vs-proxy-h...
for more understanding.
>
> On Wed, Aug 6, 2025 at 11:00 AM Khushboo Vashi <
> [email protected]> wrote:
>
>> Hi,
>>
>> Please refer
>> https://www.pgadmin.org/docs/pgadmin4/9.6/server_deployment.html#nginx-configuration-with-gunicorn
>> for nginx configuration.
>>
>>
>> On Wed, Aug 6, 2025 at 10:56 AM Shakir Idrisi <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Apologies for the interruption. May I kindly ask if the configuration I
>>> provided in my previous reply is correct?
>>>
>>> On Tue, Aug 5, 2025 at 4:57 PM Shakir Idrisi <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I updated the configuration and it's now working.
>>>> I'm using it *$http_host* instead of *$host* for the *Host *header.
>>>> Just want to confirm — is this the correct and recommended way?
>>>>
>>>> location ^~ /pgadmin4/ {
>>>>>
>>>>> proxy_pass http://unix:/tmp/pgadmin4.sock;
>>>>> proxy_set_header Host $http_host; # here i have changed $host to
>>>>> $http_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_set_header X-Forwarded-Host $host;
>>>>> proxy_set_header X-Script-Name /pgadmin4;
>>>>> proxy_http_version 1.1;
>>>>>
>>>>>
>>>>> proxy_read_timeout 300;
>>>>> proxy_connect_timeout 60;
>>>>
>>>> }
>>>>
>>>> On Tue, Aug 5, 2025 at 2:55 PM Shakir Idrisi <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Do you have any updates or suggestions that could help me further
>>>>> debug this issue?
>>>>>
>>>>> On Tue, Aug 5, 2025 at 10:23 AM Shakir Idrisi <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Yes I have tried that conf which you have provided.
>>>>>> I have mentioned that in my last reply that it is not working.
>>>>>> Still getting blank page after login on https.
>>>>>>
>>>>>> On Tue, Aug 5, 2025, 9:53 AM Yogesh Mahajan <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have already provided the nginx configuration. Have you tried it?
>>>>>>> Issues is clearly with Nginx config.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Yogesh Mahajan
>>>>>>> EnterpriseDB
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Aug 4, 2025 at 4:34 PM Shakir Idrisi <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>> I’ve tried the suggested changes, but I’m still encountering the
>>>>>>>> same issue — a blank page appears after logging in over HTTPS.
>>>>>>>>
>>>>>>>> As a workaround, I modified the config_local.py file and set:
>>>>>>>> *WTF_CSRF_CHECK_DEFAULT = False*
>>>>>>>>
>>>>>>>> With this change, pgAdmin works correctly on HTTPS. However, I
>>>>>>>> understand that disabling CSRF protection is not recommended in a
>>>>>>>> production environment, so I’m looking for a more secure solution.
>>>>>>>>
>>>>>>>> Here’s a snippet of my current *config_local.py* for reference:
>>>>>>>>
>>>>>>>> DATA_DIR = '/var/lib/pgadmin4'
>>>>>>>> SQLITE_PATH = '/var/lib/pgadmin4/pgadmin4.db'
>>>>>>>> SESSION_DB_PATH = '/var/lib/pgadmin4/sessions'
>>>>>>>> STORAGE_DIR = '/var/lib/pgadmin4/storage'
>>>>>>>> AZURE_CREDENTIAL_CACHE_DIR =
>>>>>>>> '/var/lib/pgadmin4/azurecredentialcache'
>>>>>>>> KERBEROS_CCACHE_DIR = '/var/lib/pgadmin4/kerberoscache'
>>>>>>>>
>>>>>>>> SCRIPT_NAME = '/pgadmin4'
>>>>>>>>
>>>>>>>> LOG_LEVEL = 'DEBUG'
>>>>>>>> CONSOLE_LOG_LEVEL = 50 # INFO = 20, WARNING = 30, ERROR = 40,
>>>>>>>> CRITICAL = 50
>>>>>>>> FILE_LOG_LEVEL = 20
>>>>>>>> LOG_FILE = '/var/lib/pgadmin4/log/pgadmin4.log'
>>>>>>>>
>>>>>>>> Could you please help me identify the correct settings to securely
>>>>>>>> enable CSRF protection while ensuring pgAdmin functions properly over both
>>>>>>>> HTTP and HTTPS under /pgadmin4?
>>>>>>>>
>>>>>>>>>
^ permalink raw reply [nested|flat] 26+ messages in thread
end of thread, other threads:[~2025-08-06 10:10 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 07:04 Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path Shakir Idrisi <[email protected]>
2025-06-10 09:55 ` Yogesh Mahajan <[email protected]>
2025-06-10 10:23 ` Shakir Idrisi <[email protected]>
2025-06-10 11:56 ` Yogesh Mahajan <[email protected]>
2025-06-16 04:25 ` Yogesh Mahajan <[email protected]>
2025-06-20 06:08 ` Shakir Idrisi <[email protected]>
2025-06-20 07:54 ` Shakir Idrisi <[email protected]>
2025-06-23 03:42 ` Yogesh Mahajan <[email protected]>
2025-07-31 13:57 ` Shakir Idrisi <[email protected]>
2025-08-03 16:51 ` Shakir Idrisi <[email protected]>
2025-08-04 05:08 ` Yogesh Mahajan <[email protected]>
2025-08-04 07:01 ` Shakir Idrisi <[email protected]>
2025-08-04 07:16 ` Yogesh Mahajan <[email protected]>
2025-08-04 07:32 ` Shakir Idrisi <[email protected]>
2025-08-04 08:05 ` Yogesh Mahajan <[email protected]>
2025-08-04 09:45 ` Shakir Idrisi <[email protected]>
2025-08-04 10:55 ` Yogesh Mahajan <[email protected]>
2025-08-04 11:04 ` Shakir Idrisi <[email protected]>
2025-08-05 04:22 ` Yogesh Mahajan <[email protected]>
2025-08-05 04:53 ` Shakir Idrisi <[email protected]>
2025-08-05 09:25 ` Shakir Idrisi <[email protected]>
2025-08-05 11:27 ` Shakir Idrisi <[email protected]>
2025-08-06 05:26 ` Shakir Idrisi <[email protected]>
2025-08-06 05:30 ` Khushboo Vashi <[email protected]>
2025-08-06 06:08 ` Shakir Idrisi <[email protected]>
2025-08-06 10:10 ` Khushboo Vashi <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox