• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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