Apache AddOutputFilterByType is deprecated. How to rewrite using mod_filter?

后端 未结 3 1595
一向
一向 2020-12-13 15:11

AddOutputFilterByType is deprecated in Apache.

The documentation says that the same functionality is available using mod_filter.

I currently use



        
3条回答
  •  失恋的感觉
    2020-12-13 15:57

    I'm using mod_filter for substituing instead of deflating, but the idea is the same. This is what worked for me (I'm doing reverse proxy and rewriting urls and links):

    LoadModule substitute_module modules/mod_substitute.so
    LoadModule filter_module modules/mod_filter.so
    
    FilterDeclare MYFILTER
    # syntax changed in Apache2.4  (see also  https://httpd.apache.org/docs/current/mod/mod_filter.html)  
    FilterProvider MYFILTER SUBSTITUTE "%{Content_Type} = 'text/html'"
    FilterProvider MYFILTER SUBSTITUTE "%{Content_Type} = 'text/xml'"
    FilterProvider MYFILTER SUBSTITUTE "%{Content_Type} = 'application/javascript'"
    FilterProvider MYFILTER SUBSTITUTE "%{Content_Type} = 'application/json'"
    
     
      ProxyPass        http://localhost:8300/
      ProxyPassReverse http://localhost:8300/
      ProxyPassReverseCookiePath / /sial/  
      FilterChain MYFILTER
      Substitute "s|/tea_sial_v2|/sial/tea_sial_v2|inq"
    
    

提交回复
热议问题