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 1uOt22-00D2y2-9T for pgadmin-support@arkaria.postgresql.org; Tue, 10 Jun 2025 07:04:26 +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 1uOt20-0013IL-7s for pgadmin-support@arkaria.postgresql.org; Tue, 10 Jun 2025 07:04:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uOt1z-0013ID-Od for pgadmin-support@lists.postgresql.org; Tue, 10 Jun 2025 07:04:24 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uOt1y-001CvC-16 for pgadmin-support@lists.postgresql.org; Tue, 10 Jun 2025 07:04:23 +0000 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-60700a745e5so7460032a12.3 for ; Tue, 10 Jun 2025 00:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webuzo-com.20230601.gappssmtp.com; s=20230601; t=1749539061; x=1750143861; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=w6r3K59ONqbgr1k7vVhu/XESklEY2J8bcFYPR62UJIA=; b=KdT4Odakjn7hOi1bvGx8uHA3fcX8PtmHZcTNssRP2VhCfqhqtiu2L/RrGgtWhZ/QKa 6/P7uI9x0gR1EAmfSTfpYAfV8i2YaBBVaHLxRkZtWfwFFHLxTJdjT+30QEdYthqZ0Ji7 +41R+BvQnLSLReDUk+/6gQZr8rf1EYnNq/02Lsq9Ngebs6dU2eS1y1OV+P3Ha8HNnb84 NRxdorWs0J/Hqkd87fw/7/sLWFwVKt/QjECx+MXcb92A5mU8wnKYbYS5/pbAttx0x0gL jBvee5JtK3S1Tpgz2ooy7L69cN53OoYXIjrsxVRLdgSAu180jU+m8lvAHxbn0vjpm5P6 5Vmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749539061; x=1750143861; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=w6r3K59ONqbgr1k7vVhu/XESklEY2J8bcFYPR62UJIA=; b=UtBOI/VwPmjlGJT1/MI8IOpGZkFRkQuFrp12AsU2nVTjtLmX0SzM0OWG1JEgVdzbt+ 4Y8YFTeki4jkyNkyQhPJtoLdOEDf5BXWaxb6kQPffZuttK2Ay0F8PNTAIF4EpltKLDQ6 5umZyNEH4cI7rEovgpIqFKm3bR4ZWKqKsww+eD20cQPj0eHp9hx4MnR4GkQnrzOm+bTJ 8vzWmo9mHlirAPtRa7tyR8EbKI8D0hwtobtfIydLxY2Pn6eNNZ9u6R3vi6Fi90y2qaOb Nc9Uuj8bUDezXLslN2EE1V4TyKTfqha3icVJ4YKoL2akR1SqAl+KvVGvqEwDcGRFll9E kP7w== X-Forwarded-Encrypted: i=1; AJvYcCWD8qUlT3nJlfmv1q4+bHVmowVf1666Ks+F/FvNBHcv6H7oxQ8rp373BwpFn0JuUVjpn8SLTOkcLVrCdou9EIY=@lists.postgresql.org X-Gm-Message-State: AOJu0YyxPHwIWX95VMGgEjM6oqHQ7t9McLcEW6ImxvIWB+iCiuStc+np iD2UNktJLcWGP3WFjI0UN4P6pbXBZle345O74QUyC2YnD7aOiFf6tXR7uTN6aoddDlsrE6AIc17 5zlSiUxcrJwemGIJlZTd3JsejblPS1A+zY3iioKyW5Kaw2qHiXfhNxBg= X-Gm-Gg: ASbGncsRjLIlU+TX+8i35eDCGTGtSxcZlicpJjcWgE4Zjt5j4XEFh5fbMKkc50aLL9S Ad6A/E0xp56QYSeLc0sB/rUbWrk61dGgN+KziQHm9RFFIEMeu40BX+tsbgW+flP+d89JItcTbc5 P/WsMcUJ1VXE/Nh1Fy6nhjeTFqR48shKtr2vxYBFqlSVrr X-Google-Smtp-Source: AGHT+IGmejVagZRkPQoW/KM9W/7M2xi71L4wu4IrgJCYbwmyRQVK/MxogB5toowmKAWvfOZ1WblvzJLo1PNzLH7kdDo= X-Received: by 2002:a17:907:7e96:b0:ad8:9428:6a27 with SMTP id a640c23a62f3a-ade1aa4735dmr1371812466b.50.1749539060431; Tue, 10 Jun 2025 00:04:20 -0700 (PDT) MIME-Version: 1.0 From: Shakir Idrisi Date: Tue, 10 Jun 2025 12:34:09 +0530 X-Gm-Features: AX0GCFu5Ah73lGpDc1DfNInCBo4PbM2WIjB3aB5kQwLYfjxdcJDnT_nXBcm_a9g Message-ID: Subject: Issue with pgAdmin 4 Login Behind NGINX Reverse Proxy at /pgadmin4 Path To: support@lists.postgresql.org, pgadmin-support@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000037cf8e0637324e99" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000037cf8e0637324e99 Content-Type: text/plain; charset="UTF-8" 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. --00000000000037cf8e0637324e99 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi,

I've installed pgAdmin 4 on my Linux server and con= figured it behind Gunicorn and NGINX, accessible at:
https://domain.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-Forwarde= d-For $proxy_add_x_forwarded_for= ; proxy_set_header X-Forwarde= d-Proto $scheme; # Inform pgAdmin it's served und= er a subpath proxy_set_header X-Script-N= ame /pgadmin4; # Optional: timeouts and static asse= t 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.

--00000000000037cf8e0637324e99--