Question

Configuring PGAdmin Server Mode on Ubuntu

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.


Submit an answer


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!

Sign In or Sign Up to Answer

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.

KFSys
Site Moderator
Site Moderator badge
March 12, 2025

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

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.