I can't connect to the API

Hello,

I cannot connect to the hestiacp API in the Hestia panel, I have it enabled for all users. I’m creating my own panel for hosting, but I can’t connect to the API, I get the message “Error: IP is not allowed to connect with API” and I have the machine’s IP address set

Are you not using Cloudflare?

I do not use Cloudflare.

I did everything right

1234

And that ip is the public ip of the machine from where you are trying to do the API calls?

No, this is the server’s IP address

If I gave the address 0.0.0.0, it works, but if I give my IP or the server IP, it doesn’t work

Yes 0.0.0.0 works but you open it to the world. You must identify the public ip of your client machine (not the server machine) and add it to the Allowed IP list.

I entered my IP address into the whitelist on the server but it doesn’t work

add 127.0.0.1 aswell and try again.

1 Like

This address works 127.0.0.1

I thought you were trying to use the api from an external machine. For next time, you can look at the nginx log of hestia /var/log/hestia/nginx-access.log and you will see a 401 error where you can see the ip (first field) you are trying to access.

Something like this:

203.0.113.1 - - [16/Sep/2023:15:14:11 +0200] POST /api/ HTTP/2.0 "401" 44 "-" "curl/7.81.0" "-"
1 Like

It wasn’t me who wanted to connect to the API with the Hestiacp panel that I have on the server

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.