Analysis of Nginxfilter Module

Source: Internet
Author: User
We know that many functions of nginx are implemented through the filter module, such as replacing the submodule of content and the gzipmodule of content compression. Next, let's take a look at how nginx processes the filter module. All the code of Nginxfiltermodule is in the src \ http \ module \ directory.

We knowNginxMany functions are implemented throughFilterModule, such as replacementContentOfSuB moDuLe,ContentCompressionOfGZipModule. Next let's take a look.NginxHow to handleFilterModule.

Nginx filter moduleAll the code is inSrchttpmoduleDirectory.NginxMore than a dozenFilter module,Xxx_filter_module.cThe source file at the end isFilter module.

HttpRequests are dividedHeader,ContentTwo parts, you can find out by looking at the code roughly,NginxPairHttp Header,ContentUse a separateFilterFunction. For example, we can see thatGzipFilter moduleCode can be found,Ngx_http_gzip_header_filterThe function isNginx gzipPairHttp HeaderSameNgx_http_gzip_body_filterThe function isHttp Content.

NginxCall the dozensFilterThe function process is discussed in this section.

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.