I installed pgadmin4 in my ubuntu server with SERVER_MODE = True.
I have nginx as the web server handling all the request. How do I set up nginx to serve pgadmin4?
Also How do I create pgadmin4 to start automatically when the server start?
I installed pgadmin4 in my ubuntu server with SERVER_MODE = True.
I have nginx as the web server handling all the request. How do I set up nginx to serve pgadmin4?
Also How do I create pgadmin4 to start automatically when the server start?
You've really only got a handful of options here.
(1) Use nginx
and a backend that runs the pgAdmin4.py
Python file. Whether this is Unicorn, or uwsgi
launched, and you proxy_pass
or similar to the backend in nginx
is up to you, however this is one option.
(2) Launch pgAdmin4.py
(doesn't matter if it's SERVER_MODE = True
or SERVER_MODE = False
), run it on the standard localhost:5050
port, and then set up nginx
to proxy_pass
all requests to the configured domain/hostname to pass off to the backend, with:
location / {
proxy_pass http://localhost:5050;
}
... or similar.
Beyond that there's not really much you can do otherwise to get pgAdmin4.py
to work with nginx
. (I use the second of these options on my laptop, with a customized configuration and pgAdmin4 launched as a dedicated system user)