public inbox for [email protected]  
help / color / mirror / Atom feed
From: Glen Bakeman <[email protected]>
To: [email protected]
To: pgadmin-hackers <[email protected]>
Cc: Yogesh Mahajan <[email protected]>
Subject: Re: pgAdmin Docker container: specify web URL path prefix?
Date: Wed, 13 Apr 2022 19:32:54 -0700
Message-ID: <MW4PR17MB4513B69FEC2ADBA803669F68ABEF9@MW4PR17MB4513.namprd17.prod.outlook.com> (raw)
In-Reply-To: <MW4PR17MB45136D6BF73E622BDE40B093ABEC9@MW4PR17MB4513.namprd17.prod.outlook.com>
References: <MW4PR17MB4513FBC690156566FB0E5A17ABED9@MW4PR17MB4513.namprd17.prod.outlook.com>
	<CAMa=N=NBvJv9vtCPz67a4jEP57ioVJwfTvscKXpA3JNidC-pKw@mail.gmail.com>
	<MW4PR17MB4513397D5F05F0013DDDC150ABEC9@MW4PR17MB4513.namprd17.prod.outlook.com>
	<CAMa=N=P3Y-K-pY86R1qHtED9B_Gm5WSY7DpZtX0=n-HSEmZWvA@mail.gmail.com>
	<MW4PR17MB45136D6BF73E622BDE40B093ABEC9@MW4PR17MB4513.namprd17.prod.outlook.com>

For anyone watching this: I've made an issue 
<https://redmine.postgresql.org/issues/7315; to track updating the docs. 
If someone can give me the OK I'll go and get it done.

Glen

On 4/13/2022 11:40 AM, Glen Bakeman wrote:
>
> Of course! My docker labels are as follows:
>
> - "traefik.http.routers.pgadmin4.rule=Host(`host.example.com`) && 
> PathPrefix(`/pgadmin4`)"
> - "traefik.http.routers.pgadmin4.tls=true"
>
> This assumes that the chosen name for the instance is "pgadmin4", 
> which is entirely up the user. The Host portion was necessary because 
> Traefik will complain otherwise about a lack of specificity in the 
> rule. I also added the .tls line since Traefik will only forward 
> insecure requests without it (not sure why yet). Otherwise, Traefik is 
> able to automatically identify the necessary port on the service to 
> communicate with. I added the SCRIPT_NAME environment variable which 
> seemed to be the key I was missing.
>
> Thanks again for your help,
>
> Glen
>
> On 4/12/2022 10:19 PM, Yogesh Mahajan wrote:
>> Glad to hear it!
>> Can you please share what additional steps are required?
>>
>> Thanks,
>> Yogesh Mahajan
>> EnterpriseDB
>>
>>
>> On Wed, Apr 13, 2022 at 7:49 AM Glen Bakeman <[email protected]> wrote:
>>
>>     Yogesh,
>>
>>     Not only was my DuckDuckGo-fu failing me, I didn't even get to
>>     the bottom of the page...
>>
>>     I had to make a few small tweaks since I'm on Traefikv2, but I'd
>>     be happy to update the documentation. Thank you for putting me in
>>     the right direction!
>>
>>     Glen
>>
>>     On 4/11/2022 9:11 PM, Yogesh Mahajan wrote:
>>>     Hi Glen,
>>>
>>>     Please refer to the last point at this
>>>     <https://www.pgadmin.org/docs/pgadmin4/6.8/container_deployment.html;
>>>     web-page for hosting pgadmin4 under subdirectory with Traefik.
>>>     Here is example when pgadmin4 is hosted under /pgadmin4/
>>>     docker run --name"pgadmin4"  \
>>>          -e"[email protected]"  \
>>>          -e"PGADMIN_DEFAULT_PASSWORD=SuperSecret"  \
>>>          -e"SCRIPT_NAME=/pgadmin4"  \
>>>          -l"traefik.frontend.rule=PathPrefix:/pgadmin4"  \
>>>          -d dpage/pgadmin4
>>>
>>>     Thanks,
>>>     Yogesh Mahajan
>>>     EnterpriseDB
>>>
>>>
>>>     On Tue, Apr 12, 2022 at 6:23 AM Glen Bakeman <[email protected]>
>>>     wrote:
>>>
>>>         Hi everyone,
>>>
>>>         I'm getting into containerized hosting, and I'd like to
>>>         setup the
>>>         pgAdmin docker container with a reverse proxy (Traefik).
>>>         Traefik
>>>         supports Path Prefix proxying for services (i.e, I'd like to
>>>         access
>>>         pgAdmin at host.example.com/pgadmin/
>>>         <http://host.example.com/pgadmin/;). The issue seems to be that
>>>         pgAdmin automatically rewrites requests to
>>>         host.example.com/login <http://host.example.com/login;, which
>>>         breaks the proxy.
>>>
>>>         I can't seem to find any options that allow us to specify
>>>         the web path
>>>         pgAdmin uses, from the perspective of configuring the docker
>>>         container.
>>>         Can anyone please confirm this?
>>>
>>>         Thanks in advance,
>>>
>>>         Glen
>>>
>>>
>>>

view thread (8+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pgAdmin Docker container: specify web URL path prefix?
  In-Reply-To: <MW4PR17MB4513B69FEC2ADBA803669F68ABEF9@MW4PR17MB4513.namprd17.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox