Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is HTTP Strict Transport Security (HSTS) (Apache)? [closed]

Can anybody tell me how to enable HSTS in Apache server. What are the security features of enabling this?

like image 906
Anant Waykar Avatar asked Oct 15 '25 14:10

Anant Waykar


1 Answers

HSTS is a HTTP header telling the client that a certain domain/subdomain should always be accessed by HTTPS protocol.

In your httpd.conf goes:

# Optionally load the headers module:
LoadModule headers_module modules/mod_headers.so

<VirtualHost 67.89.123.45:443>
    Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
</VirtualHost>

(Taken from this article.)

I would suggest starting with a small max-age, so your site will work in a few moments in the case you screw up.

like image 95
Jirka Hrazdil Avatar answered Oct 19 '25 10:10

Jirka Hrazdil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!