Nginx Module Reference manual: HTTP Header Processing module (HTTP Headers)

Source: Internet
Author: User
Keywords Http nginx http Header Processing Module
Tags aliyun available in cache compiled configure control default default value

These modules are all compiled into Nginx by default unless a module is manually specified to be excluded in configure. &http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP;

This module allows you to set any HTTP headers.
The following example:

Expires 24h; Expires flushes +24h; Expires @15h30m; Expires 0; expires-1; Expires epoch; Add_header Cache-control Private;

Instructions

Add_header

Syntax: Add_header Name value
Default value: None
Working with fields: HTTP, server, location
Add headers for HTTP replies when the server answer code is 200, 204, 301, 302, or 304.
This value can be used in variables
Note that this instruction will only add a new field to the header of the output, but not some of the defined headers (such as server), if you want to implement this operation, you can use a Third-party module Headers_more.
Note: Add_header only applies to 200, 204, 301, 302, and 304 responses.

Expires

Syntax: Expires [time| @time-of-day|epoch|max|off]
Default value: Expires off
Working with fields: HTTP, server, location
This command controls whether to mark an expiration date in the answer, and if so, how to mark it.

Off disables the modification of the expires and Cache-control fields in the header. Epoch sets the expires header to 1 whose, 1970 00:00:01 GMT. Max sets the expires header to December 2037 23:59:59 GMT, maximizing Cache-control to Perton. If you set an instruction to a value that does not have a @ tag, the expiration time will be the relative time of the response time (if the time is before "flushes"), or when the file is modified (when "flushes" exists, Available in version 0.7.0 and 0.6.32, and you can specify a negative time, which sets the Cache-control header to No-cache comparison. If the value of the directive is set to a value with an @ tag, an absolute time-of-day expiration is specified, and two formats, either HH or hh:mm, can be specified, where h is 0 to 24,m in size ranging from 0 to 59 (available in 0.7.9 and 0.6.34).

A non-negative time value sets the Cache-control header to Max-age = #, #将适当的换算为秒数.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.