Get Virtualizor

Edit Domain Forwarding Record

Use the Edit Domain Forwarding Record API to edit domain forwarding record for the vps present on your server by passing the VPS UUID to the API. The VPS UUID can be obtained from the List Virtual Server API where you can filter the list by passing the VPS name/ VPS ID.

The API response will contain "done" as "Saved Changes" on successful update of the record.

VPS Domain Forwarding feature in Virtualizor allows VPSes to host HTTP/HTTPS services or any other TCP services on a private IP without any need for a public IP. To host an HTTP/HTTPS service, all that is required for a VPS is a valid domain name registered with any Domain Registrar. This domain name must point to any one of the source IPs made available for VPS Domain Forwarding by Virtualizor administrator.

For more information you can refer this Manage VPS Domain Forwarding Guide.

HTTP Request



actGEThaproxyThe action specified to carry out operation and return dataYes
idPOSTIntThe ID of the haproxy recordYes
seridPOSTIntThe ID of the serverYes
vpsuuidPOSTtextThe uuid of the vpsYes
protocolPOSTtextThe protocol for the domain forwarding can be (HTTP, HTTPS, TCP)Yes
src_hostnamePOSTtextThe source hostname can be IPYes
src_portPOSTtextThe source portYes
dest_ipPOSTtextThe destination IP of the vpsYes
dest_portPOSTtextThe destination port of the vpsYes
actionPOSTtextThe action to be performed should be 'editvdf'Yes

Sample Code



    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['id'] = 2;
    $post['serid'] = 0;
    $post['vpsuuid'] = 'tfri5lvqzl8lqhvt';
    $post['protocol'] = 'TCP';
    $post['src_hostname'] = '';
    $post['src_port'] = 1226;
    $post['dest_ip'] = '';
    $post['dest_port'] = 8080;
    $post['action'] = 'editvdf';

    $output = $admin->haproxy($post);



    "title": "VPS Domain Forwarding",
    "done": {
        "msg": "Saved changes"
    "haproxydata": {
        "2": {
            "id": "2",
            "vpsuuid": "tfri5lvqzl8lqhvt",
            "serid": "0",
            "protocol": "TCP",
            "src_hostname": "",
            "src_port": "1226",
            "dest_ip": "",
            "dest_port": "8080",
            "timeadded": "1535462225",
            "timeupdated": "1535469803",
            "skipped": "",
            "vpsid": "62",
            "vps_name": "v1016",
            "hostname": ""
        "3": {
            "id": "3",
            "vpsuuid": "tfri5lvqzl8lqhvt",
            "serid": "0",
            "protocol": "TCP",
            "src_hostname": "",
            "src_port": "1224",
            "dest_ip": "",
            "dest_port": "22",
            "timeadded": "1535467331",
            "timeupdated": "0",
            "skipped": "",
            "vpsid": "62",
            "vps_name": "v1016",
            "hostname": ""
    "supported_protocols": [
    "server_haconfigs": [
            "haproxy_src_ips": "",
            "haproxy_reservedports": "",
            "haproxy_reservedports_http": "80,443",
            "haproxy_allowedports": ""
    "vpsips": null,
    "timenow": 1535469804,
    "time_taken": "0.307"
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list