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 1tg7Ws-007sT3-Jv for pgadmin-support@arkaria.postgresql.org; Thu, 06 Feb 2025 19:27:15 +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 1tg7Wr-00Ar79-Ee for pgadmin-support@arkaria.postgresql.org; Thu, 06 Feb 2025 19:27:13 +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 1tg7Wr-00Ar71-2K for pgadmin-support@lists.postgresql.org; Thu, 06 Feb 2025 19:27:13 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tg7Wo-003az7-2K for pgadmin-support@lists.postgresql.org; Thu, 06 Feb 2025 19:27:12 +0000 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-7be3d681e74so113608385a.0 for ; Thu, 06 Feb 2025 11:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=turnaroundfactor.com; s=google; t=1738870030; x=1739474830; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=WcR41YLfPbjqncDnVVqdzDj+HG0y48BQtOImC6KM7No=; b=yn+wXFOW61Hv0N34ffgTZfiXXon4tc1EpNtw3xBi8XWpcS0JccWud6K8iyzGhNAF+O 4qJct9gjEjU9w4gNtDMHBhuIm46nUQoQDrcka/KllBKalhk84RQ/BvEbZKvMez7SCrRW QlGMTo4IsPVQj2pjBMS2utgLVD8VaeaAqPTnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738870030; x=1739474830; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WcR41YLfPbjqncDnVVqdzDj+HG0y48BQtOImC6KM7No=; b=J+C3URJtqif3a1qHULn+uKDBzYsv6CNe4SEOqh4eMupBtehWzMI6ZrOEeNW/QT3+Xt TYSr0PgvzC2clYV9Y3OTtqs+DlFcEya9dOtgWZOtgqKh2LKSdU+UJUNVmMyfsIK8NVAk +6h2sy2BdaNHhdvqZ0kUutsia6knooFDtDiOQhJnFXVBMkA6HVK9lI0TTJMoUZ7YLLET aAlXTANYih9CnBD1P8AA38EjF4Dc8giyz6YuQjjWIENhgvTdouHf6J+KhzCQvBBcZrUH 8paFHJ74Fh4d4P82zhu//w1A41mnGfcok8iK02fQNZA/tP9+AYYNJj0eUi+FDR5OxbtZ 2klA== X-Gm-Message-State: AOJu0YwhJishtW+0auBCuicJ3qVTdh4a4O8u8A9xc2SVcynEDTn9EaAz 1OsXvbCfUD36iQ4ibtZIYQcFxjZGlphF0o4zc5Y18iTlmXQLf9VfZxm6mS7tqoEXTITmOwYHJGn r59OqG1j5P0BhQzO4IE5pnpQ08GMm9IUmhOTSLb7y8V9eVdSjMD8= X-Gm-Gg: ASbGnctMhw+I4BOqisFL27dOYvRZcE8ZdIiRKdGqt7d9S52OXLtmwyr79YjyH6KAAUK LAF1mv4o0E99N06BH2WPlKg7B7mDPRKHJ0oPcDS5W/uom954AiZRi9qL7mbYPXrFZZggvyg== X-Google-Smtp-Source: AGHT+IEUOeloNRtkhbif/cNiX3Xb8ltgBaJ5Qd2nwjPFAyvsAsglN0Nq+sXR7iG6XKRwphm/xtj7q3Wg5L5q+e23BZQ= X-Received: by 2002:a05:620a:319e:b0:7b6:d90f:e4ca with SMTP id af79cd13be357-7c047c41858mr44064985a.26.1738870030042; Thu, 06 Feb 2025 11:27:10 -0800 (PST) MIME-Version: 1.0 From: Eamon Doyle Date: Thu, 6 Feb 2025 14:26:58 -0500 X-Gm-Features: AWEUYZk15Nq2yhPr9kg6HlV_NHW0HScSax310jzCcf7MFgaL6pD9vzT7XXjpl8Y Message-ID: Subject: Issue running pgAdmin behind a reserve proxy To: pgadmin-support@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000073a3a9062d7e3a5d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000073a3a9062d7e3a5d Content-Type: text/plain; charset="UTF-8" Hi all, tl;dr, I'm running pgAdmin on a nonstandard ssl port and it breaks after first use. Long version: I am currently running pgAdmin4 in server mode using the standard Apache configuration included with Debian 11 (installed via the pgAdmin instructions, pgadmin4-web and pgadmin4-server packages installed). The apache instance serves pgadmin over ssl on port 8443 (running a different tool on port 443) and we have a cloudflare reverse proxy in front of that that proxies on port 443 for a particular subdomain to port 8443 on our backend server. The first time I go to https://example.com/pgadmin4 and log in, pgAdmin loads as expected. However, if I log out and try to log back in, I briefly receive the pgAdmin loading animation followed by a blank white screen rather than the browser. If I watch the network tab of Chrome, I see 401 errors on the following requests: - pgadmin4/preferences/get_all - pgadmin4/browser/check_corrupted_db_file - pgadmin4/misc/bgprocess/ Looking at the logs, I see the 401 errors being generated in the Apache logs on my backend server. Restarting the web server has no effect. If I then replace https://example.com/pgadmin4 with https://example.com:8443/pgadmin4 (ie I add the port of my Apache TLS port rather than the expected 443 that the Cloudflare reverse proxy expects) in my browser, pgAdmin will load again and work as expected. Due to the security limitations of our organization, I cannot directly connect to the backend VM on port 8443, only through the Cloudflare reverse proxy. This seems like a bug with pgAdmin, but I'm wondering if anyone knows whether or not I missed a configuration option that would solve this. My Apache config is as follows: > SSLEngine on > SSLCertificateFile /secrets/pgadmin-cert.pem > SSLCertificateKeyFile /secrets/pgadmin-key.pem > > # enable HTTP/2, if available > Protocols h2 http/1.1 > > > # modern configuration > SSLProtocol -all +TLSv1.3 > SSLOpenSSLConfCmd Curves X25519:prime256v1:secp384r1 > SSLHonorCipherOrder off > SSLSessionTickets off Apache pgAdmin config WSGIDaemonProcess pgadmin processes=1 threads=25 > python-home=/usr/pgadmin4/venv > WSGIScriptAlias /pgadmin4 /usr/pgadmin4/web/pgAdmin4.wsgi > > > WSGIProcessGroup pgadmin > WSGIApplicationGroup %{GLOBAL} > Require all granted > Any ideas? Thanks Eamon --00000000000073a3a9062d7e3a5d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi all,

tl;dr, I'm running pgAdmin = on a nonstandard ssl port and it breaks after first use.

Long version: I am currently running pgAdmin4 in server mode using t= he standard Apache configuration included with Debian 11 (installed via the= pgAdmin instructions,=C2=A0pgadmin4-web and pgadmin4-server packages insta= lled).=C2=A0 The apache instance serves pgadmin over ssl on port 8443 (runn= ing a different tool on port 443) and we have a cloudflare reverse proxy in= front of that that proxies on port 443 for a particular subdomain to=C2=A0= port 8443 on our backend server.=C2=A0 The first time I go to https://example.com/pgadmin4 and log in, pg= Admin loads as expected.=C2=A0 However, if I log out and try to log back in= , I briefly receive the pgAdmin loading animation followed by a blank white= screen rather than the browser.=C2=A0 If I watch the network tab of Chrome= , I see 401 errors on the following requests:
=C2=A0- pgadmin4/<= /span>browser/check_corrupted_db_file
=C2=A0- pgadmin4/m= isc/bgprocess/

Looking at the logs, I see t= he 401 errors being generated in the Apache logs on my backend server.=C2= =A0 =C2=A0Restarting the web server has no effect.=C2=A0 If I then replace = https://example.com/pgadmin4 w= ith https://example.com:8443/= pgadmin4 (ie I add the port of my Apache TLS port rather than the expec= ted 443 that the Cloudflare reverse proxy expects) in my browser, pgAdmin w= ill load again and work as expected.=C2=A0 Due to the security limitations = of our organization, I cannot directly connect to the backend VM on port 84= 43, only through the Cloudflare reverse proxy.=C2=A0

This seems like= a bug with pgAdmin, but I'm wondering if anyone knows whether or not I= missed a configuration option that would solve this.

My Apache conf= ig is as follows:

= <VirtualHost *:8443>
=C2=A0 =C2=A0 SSLEng= ine on
=C2=A0 =C2=A0 SSLCertificateFile =C2=A0 =C2=A0 =C2=A0/secrets/pga= dmin-cert.pem
=C2=A0 =C2=A0 SSLCertificateKeyFile =C2=A0 /secrets/pgadmi= n-key.pem

=C2=A0 =C2=A0 # enable HTTP/2, if available
=C2=A0 =C2= =A0 Protocols h2 http/1.1
</VirtualHost>

# modern configura= tion
SSLProtocol =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -all +TLSv1.3=
SSLOpenSSLConfCmd =C2=A0 =C2=A0 =C2=A0 Curves X25519:prime256v1:secp384= r1
SSLHonorCipherOrder =C2=A0 =C2=A0 off
SSLSessionTickets =C2=A0 =C2= =A0 =C2=A0 off

Apache pgAdmin config

WSGIDaemo= nProcess pgadmin processes=3D1 threads=3D25 python-home=3D/usr/pgadmin4/ven= v
WSGIScriptAlias /pgadmin4 /usr/pgadmin4/web/pgAdmin4.wsgi

<D= irectory /usr/pgadmin4/web/>
=C2=A0 =C2=A0 WSGIProcessGroup pgadmin=C2=A0 =C2=A0 WSGIApplicationGroup %{GLOBAL}
=C2=A0 =C2=A0 Require all= granted
</Directory>


Any ideas?

Thanks
Eamon
--00000000000073a3a9062d7e3a5d--