Change media folder to serve up HTTPS

With Let’s Encrypt when I do GTmetrix or Pingdom test I get “Minimize redirects” where it’s asking to switch files served from http to https

The page at ‘’ was loaded over HTTPS, but requested an insecure image ‘’. This content should also be served over HTTPS.

Does anyone know how to fix this, or possibly change the entire media folder to be serving HTTPS files?

@Kalach the best way to do this in nginx level is using subs_filter directive.

subs_filter '' ''; this should be under server block.

The correct way, IMHO, to fix this is changing the URLs in database:

cd /var/www/
wp search-replace

@antopjoseph @portofacil

Thank you guys for responding.

I ended up using portofacil’s method and it worked out wonderfully!

Thanks again!

A side note question.

What are some other configurations or settings have to be changed when switching to https?

I can’t think of anything but changing your own URLs to https.