Created
September 3, 2018 08:52
-
-
Save mrunkel/40f4221c6e32b85fe6d9606e5a19b81a to your computer and use it in GitHub Desktop.
Simple HTTP to HTTPS redirect for nginx
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
server { | |
listen *:80; | |
server_name <SERVERNAME HERE>; | |
root /var/www/frontend-core/current; | |
index index.html index.htm index.php; | |
access_log /var/log/nginx/redirect-<SERVERNAME HERE>-access.log combined; | |
error_log /var/log/nginx/redirect-<SERVERNAME HERE>-error.log error; | |
rewrite ^ https://$server_name$request_uri? permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment