• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

Issue Can no longer connect to nginx from localhost

Wade

New Pleskian
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 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:
  1. /etc/hosts has an entry for mydomain.com redirecting to 127.0.1.1.
  2. Nginx is configured to listen only on the external IP address, not all interfaces.
Thus when I run e.g. 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).
 
Back
Top