Configuring a modification LB action

Configuring the ToS field in IP packets sent to the server

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter LB action view.

loadbalance action action-name

N/A

3. Configure the ToS field in IP packets sent to the server.

set ip tos tos-number

By default, the ToS field in IP packets sent to the server is not changed.

Handling the HTTP header

Perform this task to enable the system to delete, insert, or rewrite a header in an HTTP packet.

To handle an HTTP header:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter HTTP LB action view.

loadbalance action action-name

N/A

3. Delete an HTTP header.

header delete { both | request | response } name header-name

By default, the HTTP header is not deleted.

4. Insert an HTTP header.

header insert { both | request | response } name header-name value value

By default, the HTTP header is not inserted.

5. Rewrite an HTTP header.

header rewrite { both | request | response } name header-name value value replace replace

By default, the HTTP header is not rewritten.

Rewriting the URL in the Location header of HTTP responses from the server

If the Location header of an HTTP response packet contains the specified URL and HTTP port number, the system rewrites HTTP in the URL to HTTPS and rewrites the HTTP port number to an SSL port number.

To rewrite the URL in the Location header of HTTP responses from the server:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter HTTP LB action view.

loadbalance action action-name

N/A

3. Rewrite the URL in the Location header of HTTP responses from the server.

ssl url rewrite location location [ clearport clear-port ] [ sslport ssl-port ]

By default, the URL in the Location header of HTTP responses from the server is not rewritten.

Specifying an SSL client policy

Specifying an SSL client policy enables the LB device (SSL client) to send encrypted traffic to an SSL server.

You must disable and then enable a virtual server for a modified SSL policy to take effect.

To specify an SSL client policy:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter HTTP LB action view.

loadbalance action action-name

N/A

3. Specify an SSL client policy for the LB action.

ssl-client-policy policy-name

By default, the LB action does not reference any SSL client policies.

Rewriting the content of HTTP responses

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter HTTP LB action view.

loadbalance action action-name

N/A

3. Rewrite the content of HTTP responses.

content rewrite value value replace replace-string

By default, the content of HTTP responses is not rewritten.

Configuring the redirection feature

This feature redirects all HTTP request packets matching an LB action to the specified URL.

To configure the redirection feature:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enter HTTP LB action view.

loadbalance action action-name

N/A

3. Enable the redirection feature and specify a redirection URL for the LB action.

redirect relocation relocation

By default, the redirection feature is disabled for an LB action.

4. Specify the redirection status code that the LB device returns to a client.

redirect return-code { 301 | 302 }

By default, the redirection status code that the LB device returns to a client is 302.

This configuration takes effect only when the redirection feature is enabled for an LB action.