502 Error with Plesk behind Nginx Proxy Manager

Are you getting 502 Bad Gateway Errors with Plesk behind Nginx Proxy Manager? Here is the solution!

502 Error with Plesk behind Nginx Proxy Manager

My current homelab/webserver setup is quite scuffed. Since I have multiple "servers" that host applications with websites I needed something to route all the different requests from outside my network to the correct internal server.

For this reason I have installed Nginx Proxy Manager which is very easy to setup and works quite well.

Most of my websites including this one is hosted on my webserver that is running Plesk. To monitor the uptime I am using updown.io that checks the status of the website in a specific intervall.

Recently I have been getting 502 Bad Gateway errors every couple of days for an hour or so.

The Issue

On my Plesk server I have set up Fail2Ban which sometimes banned my server that runs Nginx proxy manager.

The Solution

Go to the admin interface of Plesk. Open Tools & Settings -> IP Address Banning (Fail2Ban) and add your Nginx Proxy Server to Trusted IP Adresses.

Great! Next, complete checkout for full access to KHDev.
Welcome back! You've successfully signed in.
You've successfully subscribed to KHDev.
Success! Your account is fully activated, you now have access to all content.
Success! Your billing info has been updated.
Your billing was not updated.