Opened 8 years ago

Closed 8 years ago

#1109 closed defect (invalid)

sub_filter, with proxy_pass and Accept-Encoding: gzip

Reported by: Дилян Палаузов Owned by:
Priority: minor Milestone: 1.10.2
Component: nginx-core Version: 1.10.x
Keywords: Cc:
uname -a:
nginx -V: nginx version: nginx/1.10.1
built by gcc 6.2.1 20161011 (GCC)
configure arguments: --pid-path=/var/run/ --error-log-path=/var/log/nginx/nginx.log --without-poll_module --without-select_module --with-http_sub_module --http-log-path=/var/log/nginx--without-http_ssi_module --without-http_uwsgi_module --without-http_scgi_module --without-http_upstream_ip_hash_module --without-http_split_clients_module --without-http_empty_gif_module


My configuration file:
events {

worker_connections 1024;


http {

access_log /var/log/nginx/access.log;

server {

listen *:444;
location /.well-known {

sub_filter BBBB;
sub_filter_once off;
proxy_pass_request_headers on;




When I visit and send "Accept-Encoding: gzip", the BBBB replacement does not takes place. But if Accept-Encoding does not contain gzip, then the substitution happens.

I expect that the substitution does happen, even when Accept-Encoding: gzip is sent.

Change History (2)

in reply to:  description comment:1 by Дилян Палаузов, 8 years ago

Adding proxy_set_header Accept-Encoding ""; or disabling gzip compression in the backend does help.

comment:2 by Maxim Dounin, 8 years ago

Resolution: invalid
Status: newclosed

This is expected, sub_filter can't do replacements in a response which was gzipped by a backend.

Note: See TracTickets for help on using tickets.