Linux Tutorials and Reviews
linuxdo.blogspot.com
Pages
Home
Linux Cheat Sheet
OpenSUSE LAMP Server
Showing posts with label
https redirect nginx
.
Show all posts
Showing posts with label
https redirect nginx
.
Show all posts
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; }
Older Posts
Home
Subscribe to:
Posts (Atom)