I've solved it by recompiling Nginx to include the nginx_substitutions_filter module: https://github.com/yaoweibin/ngx_http_substitutions_filter_module This module allows multiple subs_filter statements per location. Seems to work just fine in my tests. -- Florin Andrei http://florin.myip.org/