Linux Tutorials and Reviews
linuxdo.blogspot.com
Pages
Home
Linux Cheat Sheet
OpenSUSE LAMP Server
Tuesday, April 10, 2012
Redirect Non-SSL requests to SSL on Nginx without Redirect Loop
Add these lines to your Nginx server{} block:
if ($scheme = "http") { rewrite ^ https://$server_name$request_uri? permanent; }
There is another way to do the same thing as:
if ($ssl_protocol = "") { rewrite ^ https://$server_name$request_uri? permanent; }
0 comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment