Re: [pgAdmin][RM4755] pgAdmin does not work behind reverse proxy if in built server is used as it is

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin][RM4755] pgAdmin does not work behind reverse proxy if in built server is used as it is
Date: 2019-09-19 10:35:29
Message-ID: CAM9w-_myO1P+iJZVZWjujrvOpTe=+HDC4gHoj4DzvSsct4uXCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Thu, Sep 19, 2019 at 3:52 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:

>
>
> On Thu, Sep 19, 2019 at 11:13 AM Aditya Toshniwal <
> aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:
>
>> Hi,
>>
>> On Thu, Sep 19, 2019 at 3:28 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>
>>> Hi
>>>
>>> On Thu, Sep 19, 2019 at 6:29 AM Aditya Toshniwal <
>>> aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:
>>>
>>>> Hi Hackers,
>>>>
>>>> Attached is the patch to allow pgAdmin to work behind proxy with its in
>>>> built server. I have used werkzeug fixer -
>>>> https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
>>>>
>>>
>>> Does this work with both X-Scheme and X-Forwarded-Proto headers as
>>> discussed?
>>>
>> The proxy fix work for all standard X-Forwarded-* headers. X-Scheme is
>> not used anywhere, X-Forwarded-Proto is more robust.
>>
>
> Right, but our existing code uses X-Scheme (as per old advice since
> removed from the Flask website - see RM3149), and users have deployments
> that will be setup that way. We need to fall back to X-Scheme if it is
> present but X-Forwarded-Proto is not, to avoid breaking their installations.
>
OK. I'll make the required changes and send you an updated patch.

>
>
>>
>>> I assume (as you haven't removed it) that it works in conjunction with
>>> the existing reverse proxy code?
>>>
>> Yes it should.
>>
>
> Cool :-)
>
>
>>
>>> Thanks!
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>> --
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB India | Pune
>> "Don't Complain about Heat, Plant a TREE"
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2019-09-19 10:39:47 Re: [pgAdmin][RM4755] pgAdmin does not work behind reverse proxy if in built server is used as it is
Previous Message Dave Page 2019-09-19 10:22:13 Re: [pgAdmin][RM4755] pgAdmin does not work behind reverse proxy if in built server is used as it is