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 ‘https://mysite.com/’ was loaded over HTTPS, but requested an insecure image ‘http://mysite.com/wp-content/uploads/2016/08/hbg-1.jpg’. 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 'http://mysite.com' 'https://mysite.com'; this should be under server block.

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

cd /var/www/mysite.com/htdocs
wp search-replace http://mysite.com/ https://mysite.com/

@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.