6

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?

2
  • Any heads up on this bro ? Jul 23, 2017 at 10:28
  • thanks for the help. I use nginx + gunicron. will give it a try.
    – sam23
    Jul 26, 2017 at 4:34

1 Answer 1

3

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)

You must log in to answer this question.