• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Docker with Nginx proxy - 502 Bad Gateway

RomanLed

Basic Pleskian
Hello,
I have a problem with the Nginx proxy for the docker.
When trying to enter the site from the container is: 502 Bad Gateway:

Code:
2020/03/16 12:15:06 [error] 28661#0: *27 connect() failed (111: Connection refused) while connecting to upstream, client: 31.0.xxx.xxx, server: ubuntu.led-glass.eu, request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.17.0.2:8181/favicon.ico", host: "ubuntu.led-glass.eu", referrer: "http://ubuntu.led-glass.eu/"
or
Code:
2020/03/16 12:15:06 [error] 28661#0: *27 connect() failed (111: Connection refused) while connecting to upstream, client: 31.0.xxx.xxx, server: ubuntu.led-glass.eu, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8181/favicon.ico", host: "ubuntu.led-glass.eu", referrer: "http://ubuntu.led-glass.eu/"

nginx.conf
Code:
    #extension docker begin
    location ~ ^/.* {
        proxy_pass http://0.0.0.0:8181;
        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-Proto $scheme;
    }

    #extension docker end

it was originally: proxy_pass http://0.0.0.0:8181; change to 127.0.0.1 or 172.17.0.2
all possible solutions from the forum and plesk support have no effect
I have added the IP addresses to the white list
 
What is this Docker?

Open 172.17.0.2/24 port 8181/tcp in the Firewall without changing nginx.conf
 
Last edited:
Used Docker

Entry on: http://led-glass.eu:8181 its work
Entry on https://ubuntu.led-glass.eu - 502 Bad Gateway Nginx

adding a new rule in domain always creates new nginx.conf with address IP http://0.0.0.0:xxx - it's not normal
 
In this forum, employees Plesk,
I have bought the server with a plesk license but with Hetzner.
Support Plesk does not accept this license, and I refer me to Hetzner, Hetzner refers me to Plesk.
I have tried several times and it is always the same.
 
I didn't know that :)

But this point can be inserted between cartoons:
If you have purchased a Plesk license from one of Plesk partners, technical support should be provided by them. Plesk partners are fully trained and deliver best-in-the-industry support for Plesk products running on their infrastructure.
 
I use Juggernaut Security and Firewall, appropriate rules were added.
but it turned out that you had to add extra rule in /etc/csf/csf.allow:
172.17.0.0/16

In addition, there are problems with "websocket", I am in touch with plesk support.
 
had the same problem with Plesk - Docker - Bluespice "502 Bad Gatway"

The only workaround for me was to disable "autoport mapping" in the Docker option and bind the proxy rule for the domain to Port 80 instead to 443. The domain was secured bei SSL through plesk before.
If I open the page after this, it also works with SSL (no errors, right certificate shown, https). That irritates me but I hope this is okay.

Maybe someone find this information also useable.
 
Back
Top