Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBEKT-00057T-3Q for pgsql-general@arkaria.postgresql.org; Mon, 19 Jun 2023 12:49:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBEKR-0000qF-Ol for pgsql-general@arkaria.postgresql.org; Mon, 19 Jun 2023 12:49:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBEKR-0000mo-DX for pgsql-general@lists.postgresql.org; Mon, 19 Jun 2023 12:49:55 +0000 Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBEKO-003QWx-K5 for pgsql-general@lists.postgresql.org; Mon, 19 Jun 2023 12:49:54 +0000 Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-5700401acbeso39781817b3.0 for ; Mon, 19 Jun 2023 05:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687178991; x=1689770991; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PTmrkhUQpmC+bvw49Bi1ZwDaAY43wXJp768YRd/aEww=; b=XKnTOcbvmSewmiR/cczmBwDhI4TfMI+42Tcc/mPzPORgNXJCdbyCOIgO/vFsEaJHB9 CeKPpyYwHNqWzhPTc3w0nLTPTkoe05HqXVTIW0HWoruY5GEHk5IF1ifRQ2Fy8uu70+Tt QKFLIgKb+WQ1WIzEbdME4rYGpxm+voogLKjbe0EgL++3VjoYtktACuf3KLCceHHUHwpd /1ckJTxNupZz/8xwoaLAMKnOlzgxGK96eqAwLLg7Dw9WO9PUQESZ34AHLH4Kcmnlaf5B BO0Q/5bSmrUscz3AUXZaJBQViq8h6WR3tIbqf9c8IASMB76iOd4FU01QUPcFg8N3ezfX ctFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687178991; x=1689770991; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PTmrkhUQpmC+bvw49Bi1ZwDaAY43wXJp768YRd/aEww=; b=amlu4N8iTmev4IHrV297QhIJ4WVRSCPVE0xd232d3M63qv4BHkibtSwqzpHFW8jlZv gWteJGcJNfX5waFjV2RwiiVVPM5EauHDE7vKg8CQZLLBl8DgcVUapcsGIVuqZu674qK6 1FoGBLmLswq0Wxw8t7LFi1a0zien8wFA+Dx2TpwvBFaMJieeD8pcNCQLab47LtirorUj pkptQ4r6s1xN7nXpL8Z6DDKa+W307Aex+WzunnJeP0dwcjqA/eqLcRdNSwOABuFKVmvF fCltX+1WpExcugNvPDKrv8YbK67kOH1btE5KMjg1ktb2/u9QmyJf9I0jCV8pos5M+oxw Nicg== X-Gm-Message-State: AC+VfDzMkRp6YFFBnwGmRGzQGCXZ5ItPhfBP7W3TXCt9wmYx5zSqIzPB rC4kpFS1tHi6j6JMvSySO+C/hOfgfhE= X-Google-Smtp-Source: ACHHUZ65wmUN64tYwbA27B353Q83DNZORb+b+qnjjvU0v0S088vetbtWspB5aGz3GsfX++UyyD0r8w== X-Received: by 2002:a0d:d5d5:0:b0:56d:4d7:4a45 with SMTP id x204-20020a0dd5d5000000b0056d04d74a45mr8823210ywd.52.1687178990710; Mon, 19 Jun 2023 05:49:50 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:e18f:d5cd:212b:24c8? ([2600:1700:bd2c:b810:e18f:d5cd:212b:24c8]) by smtp.googlemail.com with ESMTPSA id y65-20020a817d44000000b0057322ea1a34sm1138293ywc.108.2023.06.19.05.49.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 05:49:50 -0700 (PDT) Message-ID: <0f467ff1-8cdb-2460-75d6-0e0e4497890f@gmail.com> Date: Mon, 19 Jun 2023 07:49:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Question: Multiple pg clusters on one server can be reached with the standard port. Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <0c2dd853-08ec-dbed-00c3-a680ae711d89@proventis.net> <71943c04e05c3c13d5cd2b287909f351@weiller.eu> <20230619103335.xyagd43uhneducxz@hjp.at> From: Ron In-Reply-To: <20230619103335.xyagd43uhneducxz@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/19/23 05:33, Peter J. Holzer wrote: [snip] > You cant setup firewall rules basedon dns names. firewall rules are based on >> ip adresses and dns resolution happens on rule creation. >> I dont have an example for nginx. As I remember nginx resolves dns names >> only for variables. So setup a variable with your hostname and use this >> variable in your server definition. > 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. How would this work with JDBC clients? -- Born in Arizona, moved to Babylonia.