• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Curl problem

Alberto Almagioni

New Pleskian
I have a problem with curl.
I set up a server with Debian 9 and Plesk 17 and I moved there a website.
In this site I’m using curl to call a web service on the same domain: something like https://dev.domain.tld calling https://dev.domain.tld/functions/services.php
On my previous server (not managed with plesk) everything was working.
Here curl doesn’t work.
After a lot of googling I find a workaround putting the local ip associated with the host name in /etc/hosts
Now everything is working so I guess is a routing problem but I can’t find a way to solve it.
The server is on a /24 network. I can ping the public ip of the server from server itself but I can’t navigate (lynx) the site without the trick of hosts file...
as this is a workaround and not a solution I’d like to understand how to solve but as I’m very “newbie” on Plesk, probably I set something wrong on the server.
Thank you
Alberto
 
Under Tools > IP Addresses - associated the Public IP to local internal IP then configure Plesk DNS for the website. This will allow websites to resolve internally without having to use /etc/hosts file. Your Scheduled Task - Fetch as URL or curl www.domain.com to resolve and execute.

Note that you will need to install the Plesk DNS extension.

The one downside of this is that internally, the website will resolve to external IP which can become an issues in some circumstances.
 
Back
Top