Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uOviY-00DpAa-Cu for pgadmin-support@arkaria.postgresql.org; Tue, 10 Jun 2025 09:56:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uOviW-002ilF-AP for pgadmin-support@arkaria.postgresql.org; Tue, 10 Jun 2025 09:56:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uOviW-002il6-0g for pgadmin-support@lists.postgresql.org; Tue, 10 Jun 2025 09:56:28 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uOviT-001DPB-2k for pgadmin-support@lists.postgresql.org; Tue, 10 Jun 2025 09:56:27 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e812c817de0so4663497276.0 for ; Tue, 10 Jun 2025 02:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1749549383; x=1750154183; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Gyt+OuevEPg7/jiHiyHHP70WSr3Bj/9ciY+cCNviNDk=; b=B/EkP0hJr8Y8h8mTgh9tlC/jqksV/IzEoE7W/SxmbOzR19KCUpzkeZaPiiEAZ45PMf ktNl9kk0b7Lq04b8gHM+BL1o8c8GultLk+P5M/VHKjTP51/P4HTZSib35OQU0oS6DP1K D67quRpM/OQALY71tOi1wII4SJgw/43EDkEwi98A9yWKSZLrEwy0JawA1lrN4X+2rG8H Vv3SwSkjH/fnQ98htvsr2XQAxKeiIs+ct8kNZHCqAhjpDQhuywj9lqRHvXfA1xxiylZ3 HbMACQmjDeFVTAKyjlgzGKZaSqxTz9dhHtugY854fc95jIeLU/9JxQ8PvljBqo0eR6vj nziA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749549383; x=1750154183; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Gyt+OuevEPg7/jiHiyHHP70WSr3Bj/9ciY+cCNviNDk=; b=D3mZfHxPE3QjKDE+HpzESIlkqy4zI0aO+RvrzPeBmEVs7Z5PJIrJz7N/EWixiCCT9A qx25gw3rMgd0QHj/j5/7WlQQ24FPHTJLrjn3XpSkJvHxhjQuzIyZG6u66UVR+Mnpgt5B xjetjaGnhGCCbhgeQoBOyJ6ifs6Y5hl2D4K4BNxhmW9mirH0j+QvXLemWcM6dhl9QqIs JLncmoH+nYEy1uJKhsA4hW9nsrhBPjGHtILUrqQcDFL/kdJdIWM1hiWAMuAP4CCSWJpk Uw+WVWMtQvdQFikyxnVyovadmcXg94pnhUl1pvoWSEMRv0VZF7omB0/VQ3TP7LR06NPl e5Zg== X-Forwarded-Encrypted: i=1; AJvYcCUCQ33fxU241F7gfvMCJQd7l0INx25HDdxttWiNxDLM7i6ZcYlpl8mlA0haVuggZmAXrrY+HNWtIDsumwqJVuI=@lists.postgresql.org X-Gm-Message-State: AOJu0Yx5lUyDTQ8x6W6jpqoUsu2D+Ooxw57ivSCTXNrR6ekQ+CqnMuy+ kXV3hpxC/fJ5n4sEE/ZyDFzJZMwa6d6umKZFGnwXnOXZ60V9FYXTicLXQhYAOFYKURmON6N8ph+ ZqR6qI4uENWSlcm8vSfnbHJH1FEDlj9G9PEJQZsnp X-Gm-Gg: ASbGncu81HWX8wHQrfQr2V75gK0AEFn6xW71pMVqHKHbmDfDXGLQUoTm0lXjrMSOH74 0MMi9psHW87visCGc6WucGxKws2iZQDpbfHRh4Yh4ejm+w2Pr/EFXZaNBgzPd88T9hJ6hm6mD3Y 3UbTOw27kw4crhLJH1/u/2aIrzJuyY1fKFuqGCmbHWIU+ZjRJ4i+to4+xpr3P8W9AZC6YgdVvIs FaA X-Google-Smtp-Source: AGHT+IGk2LjtZ3RnZguGDQBI8N2YUXRYpeylxceyUL+GEtcIMIqpvmOjsyfccxyDN34Ib3iWh1213cQWZjrfRIyIW2o= X-Received: by 2002:a05:6902:c0d:b0:e81:f85d:a00f with SMTP id 3f1490d57ef6-e81f85dac7cmr949896276.0.1749549382918; Tue, 10 Jun 2025 02:56:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Yogesh Mahajan Date: Tue, 10 Jun 2025 15:25:46 +0530 X-Gm-Features: AX0GCFtOWD5wT_NLPoikUOXQv7dG19PupBVuY-KY4qaHKSOCP6MczMZGNnsacdU Message-ID: Subject: Re: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path To: Shakir Idrisi Cc: support@lists.postgresql.org, pgadmin-support@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000007c7e66063734b589" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000007c7e66063734b589 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFPM Shakir Idrisi = wrote: > Hi, > > I've installed *pgAdmin 4* on my Linux server and configured it behind *G= unicorn > 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. > --0000000000007c7e66063734b589 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Can you please share your guicorn command?=C2=A0
How many = workers are you=C2=A0spawning? It should be 1.

Thanks,=
Yogesh Mahajan
EnterpriseDB


On Tue, Jun 10, 2025 at 12:34=E2=80=AFPM Shak= ir Idrisi <shakir@webuzo.com>= ; wrote:

Hi,

I've installed pgAdmin 4 on my Linux server and con= figured it behind Gunicorn and NGINX, accessible at:
https://do= main.com/pgadmin4/.

The login page loads correctly. However, after entering valid credential= s, I'm redirected back to the login page without any error message. Occ= asionally, I see a CSRF token error, which disappears afte= r 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 pr= oxy 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_forwar= ded_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 su= bpath (/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.

--0000000000007c7e66063734b589--