server {
listen *:443 ssl;
server_name pg.YOURDOMAIN.com;
include /usr/local/nginx/conf/ssl.conf;
include /usr/local/nginx/conf/proxies.conf;
location / {
proxy_pass http://pgadmin-backend;
proxy_next_upstream error timeout http_500 http_502;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_redirect http:// https://;
}
}
IN ANOTHER FILE ( in my case its called backends.conf )
============================================
upstream pgadmin-backend {
server 127.0.0.1:8080;
server 127.0.0.1:8080 backup;
server 127.0.0.1:8080 backup;
server 127.0.0.1:8080 backup;
}
=========================================
I dont know why but pgadmin sometimes fails in retrieving static content ( css, js, etc ) that it serves from python somehow. If one of these files fails to load the whole application becomes unresponsive.
I basically set it up so if it failes it retries again 3 times ( thats why I have 127.0.0.1 as a backup backend 3 times ). I know its ugly and its hacky, but it works.
Hope this helps.
- Jose