Hello,

On Fri, Nov 11, 2016 at 09:31:42PM -0500, TC Meggs wrote:
Package: nginx-full
Version: 1.6.2-5+deb8u4
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

  * What led up to the situation?

  I attempted to use the sub_filter directive in a location block.

  proxy_pass http://127.0.0.1:3500/;
  proxy_set_header Accept-Encoding '';

  sub_filter 'abc' 'xyz';
  sub_filter_once off;
  sub_filter_types *;

  * What exactly did you do (or not do) that was effective (or
    ineffective)?

  I attempted to make a request to the nginx server for the location block in 
question.

  * What was the outcome of this action?

  The response from the server was not substituted as expected.

  * What outcome did you expect instead?

  I expected that the server would substitute the string.

I copied an identical configuration block to an Ubuntu server and it
worked without issue, Ubuntu 16.04.1 LTS (Xenial Xerus) running
nginx-full 1.10.0-0ubuntu0.16.04.4.


I just tried to use the filter on a clean jessie system with nginx
1.6.5+deb8u4:

apt-get install nginx-full curl
rm /etc/nginx/sites-enabled/default
cat <<EOF > "/etc/nginx/sites-enabled/hello"
server {
        listen 80 default_server;
        root /srv/dir;

        sub_filter 'Hello' 'Goodbye';
        sub_filter_once off;
        sub_filter_types *;
}
EOF

nginx -t
nginx -s reload

mkdir /srv/dir
echo "Hello world!" >/srv/dir/hello.txt

curl localhost/hello.txt
Goodbye world!


Perhaps there is something else that is wrong with your general configuration.

Reply via email to