Report this

What is the reason for this report?

Configuring PGAdmin Server Mode on Ubuntu

Posted on March 10, 2025

Hello

My web runs well following the tutorial on how to setup Django gunicorn, systemd and as we know, there is a line in the nginx file that reads like this:

proxy_pass http://unix:/run/gunicorn.sock;

However, the issue that I am anticipating while reading the tutorial on how to install pgadmin4 on server mode is that in there it says that we need to add this line

location / {
        proxy_pass http://unix:/tmp/pgadmin4.sock;
        include proxy_params;
    }

which, as we see, either conflicts (or replaces or does it just add one more? ) to the first one cited above.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Accepted Answer

Heya,

Instead of putting both inside location / {}, define separate paths for each service:

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://unix:/run/gunicorn.sock;
        include proxy_params;
    }

    location /pgadmin4/ {
        proxy_pass http://unix:/tmp/pgadmin4.sock;
        include proxy_params;
    }
}
  • Requests to / (the root path) go to your Django app.
  • Requests to /pgadmin4/ go to pgAdmin.
  • This way, both services can run under the same domain without conflict. An Alternative would be to run pgAdmin on a Subdomain

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.