Hitachi

uCosminexus Application Server HTTP Server User Guide


4.10.2 How to set directives

The header customization functionality is specified in the Header directive or the RequestHeader directive. The following shows examples of setting the directive to use the header customization functionality.

Organization of this subsection

(1) When setting the response header

The response header can be set by using the set indicator of the Header directive. If the response header with the same name is already set in another module, the header value is overwritten.

The following is an example in which Expires: Sat, 1 Jan 2000 00:00:00 GMT is set in the response header. However, to set the expiry date dynamically, use the expiry date settings functionality:

Header set Expires "Sat, 1 Jan 2000 00:00:00 GMT"

(2) When adding the response header

The response header can be added by using the add indicator of the Header directive. Even when the response header with the same name is already set in another module, the header is added as an additional header. The add indicator is used to set response headers with the same name on multiple lines.

The following is an example to add Set-Cookie: HOSTNAME=HOST1; path=/; domain=www.example.com; secure in response header:

Header add Set-Cookie "HOSTNAME=HOST1; path=/; domain=www.example.com; secure"