pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.43k stars 638 forks source link

pgAdmin4 web setup does not work correctly with nginx virtual hosts/reverse proxy (RM #2531) #1245

Closed dpage closed 2 years ago

dpage commented 7 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/2531 Originally created by Dmitry Glavchev at 2017-07-04 01:31:44 UTC.

Hi,

I've been trying to setup pgAdmin4 web server behind nginx reverse proxy instead of accessing 5050 port directly. I managed to configure proxy setup however all the static resources from login page fail with error 404.

They are referencing hostname root like this:


Source code looks like this:

./pgadmin/templates/base.html:          href="{{ url_for('static', filename='vendor/bootstrap/css/bootstrap.css' if config.DEBUG else 'vendor/bootstrap/css/bootstrap.min.css')}}"/>

Can this be resolved setting custom APPLICATION_ROOT in config.py to the URL prefix I use for the proxy? Or there is more feasible workaround for this. I'm using dockerized pgAdmin4 from here: https://hub.docker.com/r/meedan/pgadmin/

Thanks!

dpage commented 7 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/2531#note-1 Originally created by Dave Page at 2017-07-04 10:42:31 UTC.

Hi

Yes, you can use APPLICATION_ROOT if needed, however it usually isn't - at least when doing this with Apache. Here's a user report of a working setup with nginx:

https://www.postgresql.org/message-id/CAHpPzY4G+bwgjkR2NBRtf-2AFt4gks6_Fxnd3He2nQtTMnjwEg@mail.gmail.com

Redmine ticket header update:

Name Old Value New Value
Tracker changed Feature Support
Status changed New Resolved
dpage commented 2 years ago

Issue closed on Redmine.