# pgAdmin reverse proxy (under subpath)
location /pgadmin4 {
    proxy_pass http://pgAdmin4_Ui/;
    proxy_set_header X-Script-Name /pgadmin4;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto $forwarded_proto;
    # Include headers for proxying
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $forwarded_proto;
    # End of headers
    proxy_redirect off;
}