ngx_http_substitutions_filter_module icon indicating copy to clipboard operation
ngx_http_substitutions_filter_module copied to clipboard

http subs filter header ignored, this may be a compressed response. while reading response header from upstream, client

Open TommehM opened this issue 10 years ago • 4 comments

2014/05/09 13:28:50 [warn] 19808#0: *312 http subs filter header ignored, this may be a compressed response. while reading response header from upstream, client: xx.xx.xx.xx, server: , request: "GET / HTTP/1.1", upstream: "http://194.71.107.80:80/", host: "tpb.rtbt.me", referrer: "http://tpb.rtbt.me/top/101"

TommehM avatar May 09 '14 13:05 TommehM

Yes. If the response is compressed. The substitution will not work. Is there any problem?

yaoweibin avatar May 11 '14 02:05 yaoweibin

Yes there is a problem: If the Content-Encoding is set to "none" then the module does still assume that the response is compressed. I understand that the header is non-standard (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11), however it seems to be needed in some special cases. I'm currently testing that, however and for the time being, I think that ignoring "none" wouldn't hurt... See also https://github.com/getgrav/grav/issues/548

stucki avatar Jan 28 '16 21:01 stucki

Hi. Thanks a lot for your work, it's very valuable. Since compressed responses are a vast majority, are there plans to enable substitution module to work on compressed responses?.

nagarciah avatar Jun 21 '16 15:06 nagarciah

i worked around this one by removing the Accept-Encoding header going to proxy then enabling gzip on the proxied response, e.g.

    gzip_proxied any;
    ...
        proxy_set_header Accept-Encoding '';
        subs_filter ... ...;

guitarama avatar Aug 10 '18 17:08 guitarama