- Server operating system version
- Ubuntu 22.04
- Plesk version and microupdate number
- 18.0.57.3
At a semi-random time yesterday - possibly coinciding with a Plesk or Ubuntu update (apt full-upgrade) - my Plesk-operated web server became unreachable from localhost. This broke a cron job that was using Plesk's
Ultimately I've narrowed it down to one of two problems, but I'm not sure which is "the" problem and thus which one to try to fix:
I found various earlier forum threads about this issue (e.g. Can't access sites from localhost) but none have any resolution.
I also don't understand why this only just broke yesterday - it was working just fine before that. Alas I don't know what the relevant config files contained prior to this breakage.
As a workaround for the cron job, I was able to rewrite it as
fetch_url
against mydomain.com.Ultimately I've narrowed it down to one of two problems, but I'm not sure which is "the" problem and thus which one to try to fix:
- /etc/hosts has an entry for mydomain.com redirecting to 127.0.1.1.
- Nginx is configured to listen only on the external IP address, not all interfaces.
curl https://mydomain.com
from my server, it tries connecting to 127.0.1.1 instead of the public IP address, and Nginx is not listening on localhost, so I get a connection refused error.I found various earlier forum threads about this issue (e.g. Can't access sites from localhost) but none have any resolution.
I also don't understand why this only just broke yesterday - it was working just fine before that. Alas I don't know what the relevant config files contained prior to this breakage.
As a workaround for the cron job, I was able to rewrite it as
curl --header 'Host: mydomain.com' https://<external IP>
, which is fine, I guess, although it'd be nice not to have to hard-code my external IP address into a random cron job (in case it changes in future - there's no way I'll remember to update this cron job).