Skip to Content
Virtual Hosts

Update an existing virtual host

PUT
/virtual-hosts/{virtual_host_id}

Path Parameters

virtual_host_id*integer

The ID of the virtual host.

Range1 <= value

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Request Body

A JSON object containing the resource data

application/json
  1. body
id*integer

The unique ID of the given Virtual Host.

name*string

The name of the virtual host, unique within the environment. For name-based type, it must be a valid domain name (e.g., my-app.example.com). For ip-based type, it must be a valid IPv4 address or an IPv4 address with port (e.g., 127.0.0.1:3000). Must not be greater than 255 characters.

root_directory?string

The document root location to be served for this virtual host. When the virtual host is linked to an application, the value must be a relative path within that application directory. When no application is linked, the value must be an absolute path. Must start with one of / Must not be greater than 255 characters.

application_listen_address?|

The network name or IP address on which the application linked to this virtual host is configured to listen for incoming requests. A valid address has http or https protocol, a domain name or IP address, an optional port and optional path. You can also specify a UNIX-socket using unix: protocol. Examples: http://127.0.0.1:8080 (for applications exposing port 8080, for example running in a Docker container), http://127.0.0.1:3000 (for applications kept alive by a daemon/background process that listens on port 3000), unix:/var/run/example.sock (for applications listening on a custom socket). Must not be greater than 255 characters.

application_id?|

The ID of the application to be associated with the virtual host. When set, the value of root_directory will be relative to this application directory.

Response Body

No Content

Example Request
curl -X PUT 'https://api.devopness.com/virtual-hosts/123' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json' \  -H 'Content-Type: application/json' \  -d '{  "id": 1,  "name": "my-app.example.com"}'
Example Response
Empty