Curl Failed to connect to domian inside panel

Hi,

I have a problem with a new server with a fresh installation.

I call the file https://example.pl/abc/cron.php

I get a response.

Failed to connect to … port 443 after 0 ms: Connection refused

Please help me solve this.

It works fine on older servers

I checked curl -s, curl -sS, curl -k

Do you use the curl command inside the same server?

Show the output of these commands (replace the domain name with the actual domain name):

getent hosts example.pl
lsof -Pn +c0 -i:443 -sTCP:LISTEN
curl -viL https://example.pl/abc/cron.php

getent hosts
127.0.1.1 example.com example

Cytat Do you use the curl command inside the same server?
yes
image

You have example.com in /etc/hosts pointing to 127.0.1.1 and Nginx is not listening on that IP.

Edit /etc/hosts to modify it, so example.com uses the real ip instead of 127.0.1.1 or execute curl like this:

curl -kL --resolve example.com:443:HereTheRealIP https://example.com/abc/cron.php
1 Like