"sub_filter_once off" not working as advertised?

Maxim Dounin mdounin at mdounin.ru
Tue Dec 12 17:07:01 UTC 2017


On Tue, Dec 12, 2017 at 04:34:36PM +0000, Jason Whittington wrote:

> I have a rule like the following where I am trying to replace 
> instances of /spf/ with /ec/apps/symmetry/spf/.   I’ve used 
> sub_filter to do this sort of thing before and had luck with it.
>         location /ec/apps/symmetry/ {
>             proxy_pass http://stl-biz-d2-hrxsymmetry.devapp.c9.equifax.com:55943/;
>             proxy_redirect / https://$host/ec/apps/symmetry/;
>             #sub filter doesn't work if the upstream server returns compressed or zipped content.
>             proxy_set_header Accept-Encoding identity;
>             sub_filter once off;  # doesn’t seem to have an effect

Given the space between "sub_filter" and "once", it is expected to 
replace "once" with "off" somewhere in the response.  You probably 
mean to write

              sub_filter_once off;



Maxim Dounin

More information about the nginx mailing list