Link site
Link a site to a Docker container to proxy requests to the container.
POST/api/servers/{server}/docker/containers/{container}/site/link
Link site to container
This endpoint allows you to link a site to a Docker container, enabling the site to proxy requests to the container.
Required attributes
- Name
site_id- Type
- integer
- Description
The ID of the site to link to the container.
- Name
port- Type
- integer
- Description
The port on which the container is listening.
- Name
host- Type
- string
- Description
IP address of the container (usually 127.0.0.1).
Request
POST
/api/servers/{server}/docker/containers/{container}/site/linkcurl -X POST "https://ploi.io/api/servers/123/docker/containers/456/site/link" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"site_id": 789,
"port": 8080,
"host": "127.0.0.1"
}'
Response
{
"message": "Docker container is being proxied via example.com on port 8080"
}