Access Caddy server API from remote http

You need to change the listen address from its default of localhost:2019 to 0.0.0.0:2019 to make it accessible from outside.

Make sure to have somekind of authentication or firewall limiting access to only you, otherwise anyone could push configuration changes to your server.

Frankly, the better approach would be to set up an SSH tunnel to your VPS such that requests locally to port 2019 would be routed through the tunnel to your VPS. That way the config API is protected by your SSH key.

ssh <username>@<server-ip> -L 2019:localhost:2019

This essentially means “bind port 2019 (on the local machine) to the SSH remote such that it makes requests to localhost:2019 on the remote”.