API Reference
POSTinstall-varnish

Install Varnish

Install Varnish is a POST request to https://api.sharkcluster.com/install-varnish in the Server Management section of the SharkCluster API. Installs Varnish and automatically reconfigures Nginx/Apache to act as a backend. It takes 2 parameters, 1 required (server_id).

Request URL

POSThttps://api.sharkcluster.com/install-varnish

How do you call Install Varnish?

  1. 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
  2. 2Send a POST request to https://api.sharkcluster.com/install-varnish.
  3. 3Include the required parameter: server_id.
  4. 4Add the optional parameter only if you need it: server_type.

Request parameters

ParameterTypeDescription
server_id
Required
stringThe Internal Unique ID of the server.
server_typestring(Install only) nginx or apache2. Defaults to nginx.

What does Install Varnish return?

A successful call returns a JSON object with the fields success and message. Check that success is true in the body: like many SharkCluster endpoints, a failure can come back with HTTP 200 and success: false.

Request sample

const axios = require('axios');

const data = {
  server_id: "0000-1111-2222",
  server_type: "nginx" // Options: nginx, apache2
};

axios.post('https://api.sharkcluster.com/install-varnish', data, {
  headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
})
.then(res => console.log("Installation:", res.data.message))
.catch(err => console.error(err));

Response

{
    "success": true,
    "message": "Varnish installed successfully. Traffic: Nginx:80 → Varnish:6081 → Backend:8080"
}

Stuck on an integration?

Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.

Contact us