Nginx Module Reference manual: HTTP addition Module (http addition)

Source: Internet
Author: User
Keywords Http nginx addition addition Module
Tags client compile compiled configuration default default value http installation

If you want to use these modules, you must specify the relevant compilation parameters at compile time.

This module can add other location before or after the current location.
It executes as an output filter, and the primary and child requests contained in other location are not fully buffered and are still passed to the client as a stream, because the length of the final answer body is unknown at the time the HTTP header is passed, and the HTTP chunked encoding is always used here.

Installation

This module is not compiled by default, and if you want to use it, you need to specify the following parameters at compile time:

./configure--with-http_addition_module

Sample configuration:

Location/{add_before_body/before_action; add_after_body/after_action;

Some restrictions

In version 0.8.17 If the current location requests a child request of its own, the included location will not be added. such as the following configuration:

Location/foo {Add_before_body/bar} location/bar {Add_before_body/baz;}

The request to connect to/foo does not add the/baz corresponding location to the field.
Also note that you can only use strings when defining the location you want to include, but you cannot use variables, so the following configuration:

Location/{set $before _action/before_action; Add_before_body $before _action;}

does not work (although it can be passed when the test configuration file is correct)

Instructions

Add_before_body

Syntax: Add_before_body URI
Default value: No
Working with fields: HTTP, server, location
Adds a URI to the front of the answer body, sending a child request for one of the processing results.

Add_after_body

Syntax: Add_after_body URI
Default value: No
Working with fields: HTTP, server, location
Adds a URI to the back of the answer body, sending a child request for one of the processing results.

Addition_types

Syntax: Addition_types mime-type [Mime-type ...]
Default value: HTML
Working with fields: HTTP, server, location
Directive (0.7.9) allows additional MIME types (default "HTML") to be processed by the location. (This instruction was spelled "Addtion_types" in the source code before 0.8.17, but was fixed after version 0.8.17). )

Related Article

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.