slb template http

HTTP templates provide a robust set of SLB options. Some options control selection of real servers or service groups, while other options modify HTTP header information or enhance website performance.

HTTP templates can be used with the following service (virtual port) types:

  • HTTP
  • HTTPS
  • Fast-HTTP

Note

Fast-HTTP is optimized for very high performance information transfer in comparison to regular HTTP. Due to this optimization, fast-HTTP does not support all the comprehensive capabilities of HTTP such as header insertion and manipulation. It is recommended not to use fast-HTTP for applications that require complete data transfer integrity.

http Specification

Type Collection
Object Key(s) name
Collection Name http-list
Collection URI /axapi/v3/slb/template/http/
Element Name http
Element URI /axapi/v3/slb/template/http/{name}
Element Attributes http_attributes
Schema http schema

Operations Allowed:

Operation Method URI Payload

Create Object

POST

/axapi/v3/slb/template/http/

http Attributes

Create List

POST

/axapi/v3/slb/template/http/

http Attributes

Get Object

GET

/axapi/v3/slb/template/http/{name}

http Attributes

Get List

GET

/axapi/v3/slb/template/http/

http-list

Modify Object

POST

/axapi/v3/slb/template/http/{name}

http Attributes

Replace Object

PUT

/axapi/v3/slb/template/http/{name}

http Attributes

Replace List

PUT

/axapi/v3/slb/template/http/

http-list

Delete Object

DELETE

/axapi/v3/slb/template/http/{name}

http Attributes

http-list

http-list is JSON List of http Attributes

http-list : [

http Attributes

bypass-sg

Description: Redirects non-HTTP traffic to a specific service group.

Type: string

Format: string-rlx

Reference Object: /axapi/v3/slb/service-group

client-ip-hdr-replace

Description: Replace the content of an existing header that matches the configured name with the client’s port number. If no header name is specified, the X-ClientPort header is used. If the replace option is not specified, and there is a header that matches the configured name, the client’s port number is added to the end of the specified header.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

client-port-hdr-replace

Description: Replaces any client addresses that are already in the header.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

compression-auto-disable-on-high-cpu

Description: Configures an automatic disable of HTTP compression based on CPU utilization. The percent option specifies the threshold.

Type: number

Range: 1-100

compression-content-type

Description: compression-content-type is a JSON List . Please see below for compression-content-type

Type: List

compression-enable

Description: Enables compression.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

compression-exclude-content-type

Description: compression-exclude-content-type is a JSON List . Please see below for compression-exclude-content-type

Type: List

compression-exclude-uri

Description: compression-exclude-uri is a JSON List . Please see below for compression-exclude-uri

Type: List

compression-keep-accept-encoding

Description: Configures the ACOS device to leave the Accept-Encoding header in HTTP requests from clients instead of removing the header.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

compression-keep-accept-encoding-enable

Description: When keep-accept-encoding is enabled, compression is performed by the real server instead of the ACOS device, if the server is configured to perform the compression. The ACOS device compresses the content that the real server does not compress. This option is disabled by default, which means the ACOS device performs all the compression.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

compression-level

Description: Specifies the compression level. Each level provides a higher compression ratio, beginning with level 1, which provides the lowest compression ratio. A higher compression ratio results in a smaller file size after compression. However, higher compression levels also require more CPU processing than lower compression levels, so performance can be affected.

Type: number

Range: 1-9

Default: 1

compression-minimum-content-length

Description: Specifies the minimum length (in bytes) a server response can be in order to be compressed. The length applies to the content (payload) only and does not include the headers.

Type: number

Range: 1-2147483647

Default: 120

failover-url

Description: If the URL in GET request cannot be reached due to server unavailability, the ACOS device sends a 302 Redirect to the client.

Type: string

Format: string-rlx

host-switching

Description: host-switching is a JSON List . Please see below for host-switching

Type: List

insert-client-ip

Description: Inserts the client’s source IP address into HTTP headers. If you specify an HTTP header name, the source address is inserted only into headers with that name.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

insert-client-ip-header-name

Description: Inserts the source protocol port of the client’s request into the HTTP header. If no header name is specified, the X-ClientPort header is used.

Type: string

insert-client-port

Description: Insert client’s port number to the end of the specified header.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

insert-client-port-header-name

Description: Inserts the client’s source IP address into HTTP headers. If you specify an HTTP header name, the source address is inserted only into headers with that name.

Type: string

keep-client-alive

Description: Keep client alive

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

log-retry

Description: Logs HTTP retries. An HTTP retry occurs when the ACOS device resends a client’s HTTP request to a server because the server did not reply to the first request.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

name

Description: Name of the template.

Type: string

Format: string-rlx

Required: Yes

non-http-bypass

Description: Redirects non-HTTP traffic to a specific service group. By default, the ACOS device will drop non-HTTP requests that are sent to an HTTP port.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

rd-port

Description: Port (Port Number)

Type: number

Range: 1-65535

Mutual Exclusion: rd-port and rd-simple-loc are mutually exclusive

rd-resp-code

Description: ‘301’: Moved Permanently; ‘302’: Found; ‘303’: See Other; ‘307’: Temporary Redirect;

Type: string

Supported Values: 301, 302, 303, 307

rd-secure

Description: Use HTTPS

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

Mutual Exclusion: rd-secure and rd-simple-loc are mutually exclusive

rd-simple-loc

Description: Redirect location tag absolute URI string

Type: string

Format: string-rlx

Mutual Exclusion: rd-simple-loc rd-secure and rd-port are mutually exclusive

redirect

Description: Automatically send a redirect response

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

redirect-rewrite

Description: redirect-rewrite is a JSON Block . Please see below for redirect-rewrite

Type: Object

req-hdr-wait-time

Description: Sets a request header wait time to prevent Slowloris attacks. All portions of a client’s request header must be received within the specified amount of time. Otherwise, ACOS terminates the connection.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

req-hdr-wait-time-val

Description: Specify wait time, 1-31 seconds.

Type: number

Range: 1-31

Default: 7

request-header-erase-list

Description: request-header-erase-list is a JSON List . Please see below for request-header-erase-list

Type: List

request-header-insert-list

Description: request-header-insert-list is a JSON List . Please see below for request-header-insert-list

Type: List

request-line-case-insensitive

Description: Parses HTTP request lines with no case sensitivity.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

response-content-replace-list

Description: response-content-replace-list is a JSON List . Please see below for response-content-replace-list

Type: List

response-header-erase-list

Description: response-header-erase-list is a JSON List . Please see below for response-header-erase-list

Type: List

response-header-insert-list

Description: response-header-insert-list is a JSON List . Please see below for response-header-insert-list

Type: List

retry-on-5xx

Description: Configures the ACOS device to retry sending a client’s request to a service port that replies with an HTTP 5xx status code, and reassign the request to another server if the first server replies with a 5xx status code.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

Mutual Exclusion: retry-on-5xx and retry-on-5xx-per-req are mutually exclusive

retry-on-5xx-per-req

Description: Do not briefly stop using a service port following reassignment.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

Mutual Exclusion: retry-on-5xx-per-req and retry-on-5xx are mutually exclusive

retry-on-5xx-per-req-val

Description: Specifies the number of times the ACOS device is allowed to reassign the request.

Type: number

Range: 1-3

Default: 3

retry-on-5xx-val

Description: Specify the number of times the ACOS device is allowed to reassign the request.

Type: number

Range: 1-3

Default: 3

strict-transaction-switch

Description: Forces the ACOS device to perform the server selection process anew for every HTTP request. Without this option, the ACOS device reselects the same server for subsequent requests (assuming the same server group is used), unless overridden by other template options.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

template

Description: template is a JSON Block . Please see below for template

Type: Object

term-11client-hdr-conn-close

Description: Enables the ACOS device to terminate HTTP 1.1 client connections when the “Connection: close” header exists in the HTTP request.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

url-hash-first

Description: Specify which end of the URL string to use to calculate the hash value.

Type: number

Range: 4-128

Mutual Exclusion: url-hash-first and url-hash-last are mutually exclusive

url-hash-last

Description: Specify which end of the URL string to use to calculate the hash value.

Type: number

Range: 4-128

Mutual Exclusion: url-hash-last and url-hash-first are mutually exclusive

url-hash-offset

Description: Enables server stickiness based on hash values. Specify how far into the string to begin hash calculation.

Type: number

Range: 0-255

url-hash-persist

Description: Enables the ACOS device to terminate HTTP 1.1 client connections when the “Connection: close” header exists in the HTTP request.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

url-switching

Description: url-switching is a JSON List . Please see below for url-switching

Type: List

use-server-status

Description: enables server load awareness, which allows servers to act as backups to other servers, based on server load.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

user-tag

Description: Customized tag

Type: string

Format: string-rlx

uuid

Description: uuid of the object

Type: string

request-header-erase-list

Specification
Type list
Block object keys

request-header-erase

Description: Erase a header from HTTP request (Header Name)

Type: string

Format: string-rlx

redirect-rewrite

Specification
Type object

match-list

Description: match-list is a JSON List . Please see below for l178_match-list

Type: List

redirect-secure

Description: Changes HTTP redirects sent by servers into HTTPS redirects before sending the redirects to clients.

Type: boolean

Supported Values: true, false, 1, 0

Default: 0

redirect-secure-port

Description: Modifies redirects sent by servers by rewriting the matching URL string (Pattern) to the specified value (Redirect To) before sending the redirects to clients.

Type: number

Range: 1-65535

Default: 443

redirect-rewrite.match-list

Specification
Type list
Block object keys

redirect-match

Description: URL Matching (Pattern URL String)

Type: string

Format: string-rlx

rewrite-to

Description: Rewrite to Destination URL String

Type: string

Format: string-rlx

response-header-insert-list

Specification
Type list
Block object keys

response-header-insert

Description: Insert a header into HTTP response (Header Content (Format: “[name]: [value]”))

Type: string

Format: string-rlx

response-header-insert-type

Description: ‘insert-if-not-exist’: Only insert the header when it does not exist; ‘insert-always’: Always insert the header even when there is a header with the same name;

Type: string

Supported Values: insert-if-not-exist, insert-always

response-header-erase-list

Specification
Type list
Block object keys

response-header-erase

Description: Erase a header from HTTP response (Header Name)

Type: string

Format: string-rlx

template

Specification
Type object

logging

Description: Specifies a logging template to use for external logging of HTTP events over TCP.

Type: string

Reference Object: /axapi/v3/slb/template/logging

url-switching

Specification
Type list
Block object keys

url-match-string

Description: URL String

Type: string

Format: string-rlx

url-service-group

Description: Create a Service Group comprising Servers (Service Group Name)

Type: string

Format: string-rlx

Reference Object: /axapi/v3/slb/service-group

url-switching-type

Description: ‘contains’: Select service group if URL string contains another string; ‘ends-with’: Select service group if URL string ends with another string; ‘equals’: Select service group if URL string equals another string; ‘starts-with’: Select service group if URL string starts with another string; ‘url-case-insensitive’: Case insensitive URL switching; ‘url-hits-enable’: Enables URL Hits;

Type: string

Supported Values: contains, ends-with, equals, starts-with, url-case-insensitive, url-hits-enable

host-switching

Specification
Type list
Block object keys

host-match-string

Description: Hostname String

Type: string

Format: string-rlx

host-service-group

Description: Create a Service Group comprising Servers (Service Group Name)

Type: string

Format: string-rlx

Reference Object: /axapi/v3/slb/service-group

host-switching-type

Description: ‘contains’: Select service group if hostname contains another string; ‘ends-with’: Select service group if hostname ends with another string; ‘equals’: Select service group if hostname equals another string; ‘starts-with’: Select service group if hostname starts with another string; ‘host-hits-enable’: Enables Host Hits counters;

Type: string

Supported Values: contains, ends-with, equals, starts-with, host-hits-enable

response-content-replace-list

Specification
Type list
Block object keys

response-content-replace

Description: replace the data from HTTP response content (String in the http content need to be replaced)

Type: string

Format: string-rlx

response-new-string

Description: String will be in the http content

Type: string

Format: string-rlx

request-header-insert-list

Specification
Type list
Block object keys

request-header-insert

Description: Insert a header into HTTP request (Header Content (Format: “[name]: [value]”))

Type: string

Format: string-rlx

request-header-insert-type

Description: ‘insert-if-not-exist’: Only insert the header when it does not exist; ‘insert-always’: Always insert the header even when there is a header with the same name;

Type: string

Supported Values: insert-if-not-exist, insert-always

compression-content-type

Specification
Type list
Block object keys

content-type

Description: Compression content-type

Type: string

Format: string-rlx

compression-exclude-uri

Specification
Type list
Block object keys

exclude-uri

Description: Compression exclude uri

Type: string

Format: string-rlx

compression-exclude-content-type

Specification
Type list
Block object keys

exclude-content-type

Description: Compression exclude content-type (Compression exclude content type)

Type: string

Format: string-rlx