Subdomain images!

Hello! friends,

Help me please! I’ve created a subdomain “img” for images but it does not work.


1) - ee site create = (Ok!)

2) - I created DNS Record A point to IP domain = (Ok!)

3) - nano /etc/nginx/sites-available/ = (Ok!)

4) - I added line…: sub_filter “” “”;

Is correct? something is missing?

The images are still in…: I wish…:

Thank you all for helping me. Regards,


Hello @Carlosara,

you can find an example of nginx configuration with sub_filter module on

But if you are using a sub-domain to improve your website loading speed with domain sharding, I can only recommend you to enable https on your website to use HTTP/2. It provide better loading speed than loading assets from a subdomain. It’s an outdated directive you can often see on websites like

Hello! Virtubox.

Thank you for helping me with your information and link.

What commands should I use for images to open in subdomain (img)?

I have never used this nginx module previsouly, but for me your configuration should look like :

    sub_filter 'https://yourwebsite.tld/wp-content/uploads/' 'https://img.yourwebsite.tld/wp-content/uploads/';
    sub_filter_once off;