Nginx's subs_filter seems not to work

I have an old WP that I recently converted to http/2, and the speed improvements were beautiful, to say the least. :smile:

However, there are several assets that are spread across several hostnames (all pointing to the same server root) because in the past dividing resources across hostnames was a boosting technique we were used to.


All of the above hostnames have their root exactly on /var/www/

Even worse, some assets are referenced by and others by

Now I want Nginx to replace all these hostnames to the normalized form, but there is no way to achieve this simple goal.

I read about subs_filter here: EasyEngine 3.3 released with Full-Page Redis Cache support. I then tried to add this to /var/www/


But no way to achieve my text replacement. :frowning:

I’m using Nginx 1.9.10 (I run an ee stack upgrade --all prior to trying this test).

Finally, I’d like to use the subs_filter to force some stubborn customers to make use of my CDN to serve their huge image files. Currently the only way to tho this is using WP Super Cache support for CDNs, but I want something they can’t break.


Anyone? Any ideas? :smiley:

Have you figured this out?

I’m trying to set up a local CDN with no luck. Created a cdn subdomain, updated subs filter. It doesn’t work.

I use Lew Ayotte’s code he provided from his blog and it works great!

However if I try to customize it to only pass certain MIME types it does not work with Autoptimize for some reason, but it works well with Autoptimize if you use it like in the blog link.