Hi,
I'm a relative noob when it comes to the world of nginx, wsgi and so forth, but I do have several other things working (a Django app under gunicorn and the RabbitMQ web UI directly behind nginx). However, I'm rather stuck getting pgAdmin4 to run at
http://mydomain.com:80/pgadmin behind nginx. Is there a simple, up-to-date example of how to do this (I'm running the latest, v4.2, of pgAdmin4)?
One of the several variables I'm struggling to understand is the choice of whether to run pgAdmin4.py on port 5050 directly behind nginx, or as a WSGI app under gunicorn. I assume the latter should be easier to set up, but I've tried both (modelled on what I have working, and various references). One combination I tried was:
- Creating a softlink from pgadmin4.py to pgAdmin4.wsgi
- Using gunicorn to run the pgadmin4.py to a unix domain socket like this:
$ /usr/local/bin/gunicorn -w 1 --bind unix:/home/ubuntu/pgadmin.sock pgadmin4:application
- Serving behind nginx like this:
location /pgadmin {
rewrite ^/pgadmin/(.*) /$1 break;
include proxy_params;
proxy_pass http://unix:/home/ubuntu/pgadmin.sock;
}
But all I get is a stubborn 404. Any pointers welcome...
Thanks, Shaheed
P.S. I considered just making pgAdmin4.py listen on
0.0.0.0:5050, but I do need to get everything behind HTTPS sooner rather than later.