Is it possible to use multiple sub_filter in one location?

Trying to do this:

location /whatever/ {
proxy_buffering off;
sub_filter ‘“df”:“https://df-foo”’ ‘“df”:“https://df-bar”’;
sub_filter ‘“pr”:“https://pr-foo”’ ‘“pr”:“https://pr-bar”’;
sub_filter_once off;
sub_filter_types *;

But I’m getting this:

nginx: [emerg] “sub_filter” directive is duplicate in …

How do I replace multiple things in one location?


Florin Andrei

I’ve solved it by recompiling Nginx to include the
nginx_substitutions_filter module:

This module allows multiple subs_filter statements per location. Seems
to work just fine in my tests.

Florin Andrei