0

I am running a full dockerized solution with 9 applications, and some of them are Ngninx and PgAdmin.

All the solution is running on a VPS with a domain.

So, my problem is when I am trying to hit my PgAdmin container for show the web page, I get a 502 bad gateway.

I send you my confi here :

 server {
  listen 80;
  server_name domain;

  location /.well-known/acme-challenge/ {
      root /var/www/certbot;
  }

  location / {
      return 301 https://$host$request_uri;
  }
}



server {
      listen 443 ssl;
      server_name domain;
      
      "ssl links here"

      location /pgadmin {
         proxy_pass http://containerIP:port;
      }

      location / {
         proxy_pass http://containerIP:port;
      }
}

What should my client url looks like for hit the PgAdmin container?

I tried this but doesn't work : https://domain/pgadmin

I precise all containers work fine, in the same network.

Thanks a lot

Raikho
  • 13
  • 5
  • have you tried to replace the IP with the hostname of the Docker container that's running pgAdmin? – javierlga Oct 12 '22 at 17:33
  • I think I tried one time, but no results. I can try again. – Raikho Oct 12 '22 at 18:08
  • Please don't post pictures of text (or links to pictures of text). Include your configuration in the question, formatted as a code sample. This makes it easier to read and interact with your question. – larsks Oct 12 '22 at 19:23
  • Ye sorry for that. – Raikho Oct 12 '22 at 19:57
  • @javierlga I tried like you suggest me to do, but no, this doesnt work. – Raikho Oct 12 '22 at 20:01
  • I precise somethings more : - my pgadmin container is not configured for ssl 443 port, only 80. But this should be not a problem? - I fixed a bad gateway for request api's from my client by adding a "/" at the end of my location, like that => location /api/ { proxy_pass ht'tp://containerIP:port/ } I don't know what can I do. Before letsenscrypt certification, on classical http, I hited my PgAdmin container without any probs with an url like this => ht'tp://domain/pgadmin – Raikho Oct 12 '22 at 20:11
  • I thougth with the same url, just add an "s" at http, should works fine... – Raikho Oct 12 '22 at 20:16
  • You can access the pgadmin UI without nginx? – IamK Oct 13 '22 at 12:30
  • How I can do that from my pgadmin container? – Raikho Oct 13 '22 at 19:15
  • Ok, I tried "curl http:/dockerIp:port" and I obtain this : curl: (7) Failed to connect to containerIP port **** : Connection refused – Raikho Oct 13 '22 at 20:06

0 Answers0