=encoding utf-8 =head1 NAME ngx_http_headers_module - Module ngx_http_headers_module =head1 The C module allows adding the C and C header fields, and arbitrary fields, to a response header. =head1 Example Configuration expires 24h; expires modified +24h; expires @24h; expires 0; expires -1; expires epoch; expires $expires; add_header Cache-Control private; =head1 Directives =head2 add_header B add_header I< I> I> [C]> B I B I B I B I Adds the specified field to a response header provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A value can contain variables. There could be several C directives. These directives are inherited from the previous level if and only if there are no C directives defined on the current level. If the C parameter is specified (1.7.5), the header field will be added regardless of the response code. =head2 expires B expires I<[C] I>> B expires I< C E C E C> B I B I B I B I B I Enables or disables adding or modifying the C and C response header fields provided that the response code equals 200, 201, 204, 206, 301, 302, 303, 304, or 307. A parameter can be a positive or negative L. A time in the C field is computed as a sum of the current time and I> specified in the directive. If the C parameter is used (0.7.0, 0.6.32) then time is computed as a sum of the file’s modification time and I> specified in the directive. In addition, it is possible to specify a time of the day using the “C<@>” prefix (0.7.9, 0.6.34): expires @15h30m; The C parameter corresponds to the absolute time “C”. The contents of the C field depends on the sign of the specified time: =over =item * time is negative — C. =item * time is positive or zero — C>>, where I> is a time specified in the directive, in seconds. =back The C parameter sets C to the value “C”, and C to 10 years. The C parameter disables adding or modifying the C and C response header fields. The last parameter value can contain variables (1.7.9): map $sent_http_content_type $expires { default off; application/pdf 42d; ~image/ max; } expires $expires;