Last active
September 5, 2024 18:28
-
-
Save jacobovidal/ef5015e4e05905c6ec684425cf30bc9b to your computer and use it in GitHub Desktop.
Upgrade Insecure Requests via .htaccess or meta tag to prevent mixed content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifModule mod_headers.c> | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> |
Only set this header to html.
<ifModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text/html#"
</IfModule>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For NginX and Plesk Panel add this line in Domain -> Apache & Nginx settings -> Additional nginx directives :
add_header Content-Security-Policy upgrade-insecure-requests;