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.