API
NGINX

NGINX

Base path: /api/cloud/nginx

Protected endpoints:

GET /api/cloud/nginx/available-port

  • Auth: Bearer (Keycloak)
  • Description: Returns a free TCP port available for routing.
  • Example:
curl -H "Authorization: Bearer $TOKEN" \
  https://your-host/api/cloud/nginx/available-port

GET /api/cloud/nginx/used-ports

  • Auth: Bearer (Keycloak)
  • Description: Lists used TCP ports managed by the service.
  • Example:
curl -H "Authorization: Bearer $TOKEN" \
  https://your-host/api/cloud/nginx/used-ports

GET /api/cloud/nginx/health

  • Auth: Bearer (Keycloak)
  • Description: Health check for NGINX management subsystem.
  • Example:
curl -H "Authorization: Bearer $TOKEN" \
  https://your-host/api/cloud/nginx/health

POST /api/cloud/nginx/create

  • Auth: Bearer (Keycloak)
  • Description: Creates a new NGINX TCP route mapping.
  • Body (JSON):
    • targetIp (string, required)
    • targetPort (number, required)
    • protocol (string, required, only tcp supported)
    • port (number, required, incoming/listening port)
    • certificate_id (number, optional)
  • Responses: 200 OK with created route; 400/500
  • Example:
curl -X POST https://your-host/api/cloud/nginx/create \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"targetIp":"203.0.113.10","targetPort":3000,"protocol":"tcp","port":22005}'

Public endpoint:

DELETE /api/cloud/nginx/routes/:port

  • Auth: None
  • Params:
    • port (number)
  • Responses: 200 OK with message; 404 if not found; 500 on error
  • Example:
curl -X DELETE https://your-host/api/cloud/nginx/routes/22005