If you have enabled https, have a public IP and want to redirect all traffic from http to https you can change the "/ location {}" section in nginx.conf to the following.
location / {
rewrite ^ https://$host$request_uri? permanent;
}
If you do not have your own public IP and use the shared SSL certificate then add the following lines to the "/ location {}" section.
if ($http_x_forwarded_proto != "https") {
rewrite ^ https://$host$request_uri? permanent;
}
Comments
Article is closed for comments.