Nginx's HTTP Filter module

Source: Internet
Author: User

1. HTTP Filter Module Ngx_http_not_modified_module

Only the HTTP header is processed. When the return 200 succeeds, the time of the browser cache file is obtained according to the If-modified-since or if-unmodified-since head of the request, and then the last modification time of the returned user file is analyzed, in order to decide whether to send 304 not Modified Response to the user.

Ngx_http_range_body_filter_module

Handles the Range information in the request, returning part of the file to the user according to the requirements in rrange

Ngx_http_copy_filter_module

Only the HTTP package is processed. The HTTP package of the NGX_CHAIN_T structure sent by the user is copied to the new ngx_chain_t structure (all pointers are copied, not including the actual HTTP response content), and subsequent HTTP filtering modules deal with ngx_chain_t types of members Ngx_ht Tp_copy_filter_module the variable after the module is processed.

Ngx_http_headers_filter_module

Only the HTTP header is processed. Allows you to add an arbitrary HTTP header to the response returned to the user by modifying the nginx.conf configuration file.

Ngx_http_userid_filter_module

Only the HTTP header is processed. This is the Http_userid_module module that is obtained when executing the Configure command, which provides a simple authentication management function based on cookies.

Ngx_http_charset_filter_module

You can return the text type to the user's response package, re-encode it according to the configuration in nginx.conf, and return it to the user

Ngx_http_ssi_filter_module

Support for SSI (server Side include, servers-side embedding) to include file content in a Web page and return it to the user

Ngx_http_postpone_filter_module

Only the HTTP package is processed. It applies only to child requests produced by Subrequest. It enables the order of multiple child requests to send a response to the client at the same time, so-called "ordered" means the response is sent in the order in which the child requests are constructed.

Ngx_http_gzip_filter_module

Gzip Compress a specific HTTP response inclusion (such as a Web page or text file) and return the compressed content to the user

Ngx_http_range_header_filter_module

Support Range Protocol

Ngx_chunked_filter_module

Supports chunk encoding

Ngx_http_header_filter_module

Only the HTTP header is processed. The filter module will serialize the members in the R->headers_out struct to the HTTP response byte stream returned to the user, including the response line (such as http/1.1) and the response header, and by calling Ngx_http_write_filter_ Filter method in module filter to send HTTP headers directly to the client

Ngx_http_write_filter_module

Only the HTTP package is processed. This module is responsible for sending HTTP responses to clients

2. HTTP Filter Module Development steps
    1. Determine the source code file name
    2. Create config file, http_modules change to http_filter_modules variable, multiple source code files to implement 1 HTTP filter modules, you need to add additional source code files in the NGX_ADDON_SRCS variable
    3. Defining the Filter module
    4. Working with configuration items of interest
    5. Implementation initialization method: The initialization method is to handle the HTTP header in the module Ngx_http_output_header_filter_pt method and processing HTTP packet ngx_http_output_body_filter_ The PT method is inserted into the header of the list of filter modules.
    6. Implements the method of handling HTTP headers: A method for implementing the NGX_HTTP_OUPUT_HEADER_FILTER_PT prototype for handling HTTP headers
    7. Implements the method of handling HTTP packets: The method of implementing the Ngx_http_ouput_body_filter_pt prototype, which is used to process the HTTP package body
    8. Compiling the installation

Nginx's HTTP Filter module

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.