联合国非洲经济委员会呼吁非洲国家采取封锁政策控制疫情蔓延 |优衣库如何在商海中屡战屡胜?一直推联名款一直爽 |俄罗斯单日新增新冠肺炎确诊病例6852例 累计62.7万例 |欧洲央行首席经济学家称必要情况下将提高债券购买规模 |巴西出现“得来速”式登记结婚 |陕西夏粮再获丰收 小麦总产增长8.5% |北京:丰台15例新增病例均与新发地相关!居住在这些社区 |一片混乱!美国油罐车高速公路疾驰冲撞抗议人群 |一波三折 玻利维亚大选日期最终确定 |马来西亚总理表态:新冠肺炎疫情不会影响马新高铁等工程进度 |
<-
Apache > HTTP Server > Documentation > Version 2.4

Filters

Available Languages:  en  |  es  |  fr  |  ja  |  ko  |  tr 

This document describes the use of filters in Apache.

top

Filtering in Apache 2

The Filter Chain is available in Apache 2.0 and higher, and enables applications to process incoming and outgoing data in a highly flexible and configurable manner, regardless of where the data comes from. We can pre-process incoming data, and post-process outgoing data, at will. This is basically independent of the traditional request processing phases.

Filters can be chained, in a Data Axis orthogonal to request processing

Some examples of filtering in the standard Apache distribution are:

Apache also uses a number of filters internally to perform functions like chunking and byte-range handling.

A wider range of applications are implemented by third-party filter modules available from modules.apache.org and elsewhere. A few of these are:

top

Smart Filtering

Smart filtering applies different filter providers according to the state of request processing

mod_filter, included in Apache 2.1 and later, enables the filter chain to be configured dynamically at run time. So for example you can set up a proxy to rewrite HTML with an HTML filter and JPEG images with a completely separate filter, despite the proxy having no prior information about what the origin server will send. This 送分电玩 by using a filter harness, that dispatches to different providers according to the actual contents at runtime. Any filter may be either inserted directly in the chain and run unconditionally, or used as a provider and inserted dynamically. For example,

top

Exposing Filters as an HTTP Service

Filters can be used to process content originating from the client in addition to processing content originating on the server using the mod_reflector module.

mod_reflector accepts POST requests from clients, and reflects the content request body received within the POST request back in the response, passing through the output filter stack on the way back to the client.

This technique can be used as an alternative to a web service running within an application server stack, where an output filter provides the transformation required on the request body. For example, the mod_deflate module might be used to provide a general compression service, or an image transformation filter might be turned into an image transformation service.

top

Using Filters

There are two ways to use filtering: Simple and Dynamic. In general, you should use one or the other; mixing them can have unexpected consequences (although simple Input filtering can be mixed freely with either simple or dynamic Output filtering).

The Simple Way is the only way to configure input filters, and is sufficient for output filters where you need a static filter chain. Relevant directives are SetInputFilter, SetOutputFilter, AddInputFilter, AddOutputFilter, RemoveInputFilter, and RemoveOutputFilter.

The Dynamic Way enables both static and flexible, dynamic configuration of output filters, as discussed in the mod_filter page. Relevant directives are FilterChain, FilterDeclare, and FilterProvider.

One further directive AddOutputFilterByType is still supported, but deprecated. Use dynamic configuration instead.

Available Languages:  en  |  es  |  fr  |  ja  |  ko  |  tr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.

送分电玩

mqczrbx.s2118.cn| mqczrbx.oniang.cn| mqczrbx.hfqo.cn| mqczrbx.i1614.cn| mqczrbx.csvh.cn| nqczrbx.tengchong-xsy.cn|