From: Thomas Markus <t.markus@proventis.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Question: Multiple pg clusters on one server can be reached with the standard port.
Date: Mon, 19 Jun 2023 13:00:54 +0200
Message-ID: <0894245c-d056-b9e5-62f5-c0ed39ad7ff1@proventis.net> (raw)
In-Reply-To: <20230619103335.xyagd43uhneducxz@hjp.at>
References: <0c2dd853-08ec-dbed-00c3-a680ae711d89@proventis.net>
<71943c04e05c3c13d5cd2b287909f351@weiller.eu>
<d869925784c9af50aa4379d4ab5ffae2@weiller.eu>
<c5f9c9b4-7a1f-8a35-406c-d7cc34285bcd@proventis.net>
<20230619103335.xyagd43uhneducxz@hjp.at>
Hi,
Am 19.06.23 um 12:33 schrieb Peter J. Holzer:
> As Francisco already pointed out, this can't work with nginx either. The
> client resolves the alias and the TCP packets only contain the IP
> address, not the alias which was used to get that address. So nginx
> simply doesn't have that information and therefore can't act on it.
>
> For HTTP this works because the HTTP protocol contains a Host field
> which the client fills with the name it used. But the Postgres protocol
> has no such information (and in any case nginx probably doesn't
> understand that protocol anyway).
>
> So (again, as Francisco already wrote) the best way is probably to write
> a simple proxy which uses the database (not DNS) name for routing. I
> seem to remember that nginx has a plugin architecture for protocols so
> it might make sense to write that as an nginx plugin instead of a
> standalone server, but that's really a judgement call the programmer has
> to make. Another possibility would of course be to extend pgbouncer to
> do what the OP needs.
>
> hp
yeah I know
I looked at his setup definition only and missed the point that he wants
a single entry point for all.
The image doesnt match this. Looks like a simple forward proxy definition.
anyway, fw or nginx cant look into tcp streams nor does it makes sense
to me. Maybe without tls
Attachments:
OpenPGP_0x9794716335E9B5AF.asc (application/pgp-keys, 3.1K) download
OpenPGP_signature (application/pgp-signature, 839B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: t.markus@proventis.net
Subject: Re: Question: Multiple pg clusters on one server can be reached with the standard port.
In-Reply-To: <0894245c-d056-b9e5-62f5-c0ed39ad7ff1@proventis.net>
References: <0c2dd853-08ec-dbed-00c3-a680ae711d89@proventis.net> <71943c04e05c3c13d5cd2b287909f351@weiller.eu> <d869925784c9af50aa4379d4ab5ffae2@weiller.eu> <c5f9c9b4-7a1f-8a35-406c-d7cc34285bcd@proventis.net> <20230619103335.xyagd43uhneducxz@hjp.at> <0894245c-d056-b9e5-62f5-c0ed39ad7ff1@proventis.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox