How to Redirect HTTP to HTTPS in Nginx

All login credentials transferred over plain HTTP can easily be sniffed by a MITM attacker, but it is not enough to encrypt the login forms. If you are visiting plain HTTP pages while logged in, your session can be hijacked, and not even two-factor authentication will protect you. To protect all info sent between your visitors – which includes you – and your web server, we will redirect all requests that are coming over plain HTTP to the HTTPS equivalent....

October 12, 2019 · 1 min · 112 words · Akhil Jalagam

How to Redirect HTTP to HTTPS in apache

Install modules Enable modules Method 1 using rewrite module RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] </VirtualHost> Method 2 using redirect method Redirect permanent / </VirtualHost>

September 4, 2019 · 1 min · 29 words · Akhil Jalagam