Laravel Community Tools by Tighten
Back to Recipes

Change all SSL sites on this server to use HSTS

mattstauffer tested 2 weeks ago

HSTS is a setting you can enable on your SSL-enabled domains to ensure browsers will never connect to the non-secured version of your web site.

https://https.cio.gov/hsts/

If you run this script, it will enable HSTS on all of your SSL-secured domains.

I've tested this on a few Tighten servers and so far it's worked, but please know this is just me writing this as best as I can.

Enjoy!

bash

Comments

Looks like we need to update this; "ssl_certificate" doesn't exist anymore. I can't find anything quickly that'll get this on modern Forge setups, so be warned, this may not be viable without some larger changes.

Log in to leave a comment.