Maxim Dounin
August 08, 2012 06:42AM
Hello!

On Tue, Aug 07, 2012 at 04:33:57PM -0400, Joesep Kilsal wrote:

> Hello, I'm trying to have nginx proxy for apache while trying to utilize
> sub_filter.
>
> My default.conf block with the modules listed above looks like this:
>
> server {
> location / {
> proxy_pass http://127.0.0.1:8080;
> proxy_set_header Host $host;
> proxy_set_header X-Real-IP $remote_addr;
> sub_filter_once on;
> sub_filter '</body>' '<p>filter test12345</p></body>';
> }
> }
>
> With this, I can remove either the proxy_pass line or the sub_filter line
> and
> the other will work. It seems to only stop working when I try to have both
> active at the same time. I did have a look around regarding this issue and
> have
> disabled gzip, but to no avail. Does anyone have any insight towards this
> issue?

Most often this question is asked when gzip is enabled on a
backend host, and hence nginx sess gzipped content which it can't
change. Where you tried to disable gzip? Correct thing to do is
to disable gzip on a backend. Alternatively, you may do

proxy_set_header Accept-Encoding "";

on nginx side. This will inform backend that content encodings
aren't acceptable and will effectively disable gzip on a backend
as well.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Getting proxy_pass to work with sub_filter

Joesep Kilsal August 07, 2012 04:36PM

Re: Getting proxy_pass to work with sub_filter

Maxim Dounin August 08, 2012 06:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 239
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready