R.W
R.W

Reputation: 560

HTTP Strict Transport Security on openshift

How do I enable HTTP Strict Transport Security on openshift portal? I am working on a php application and not very sure where to make this setting. I believe I need access to Apache configuration file to achieve this - which I don't think openshift allows.

Upvotes: 4

Views: 1756

Answers (1)

luciddreamz
luciddreamz

Reputation: 2093

Just create an .htaccess file and add the HSTS header there.

# Force https
RewriteEngine on 
RewriteCond %{HTTP:X-Forwarded-Proto} !https 
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

# Add HSTS header
Header set Strict-Transport-Security "max-age=31536000"

Upvotes: 5

Related Questions