Skip to content

How to redirect HTTP traffic to HTTPS

Lloyd Brookes edited this page Jun 24, 2019 · 8 revisions

This is required to satisfy the Lighthouse audit.

The solution

HTTP and HTTPS servers are two separate services runing on different ports (80 and 443). Therefore, we need to launch two servers - one handling HTTP on port 80, the other HTTPS on port 443. The HTTP server on port 80 should do nothing but respond with 302 Found, redirecting each request to the same origin over HTTPS.

Launch the HTTP redirecting server

Clone this wiki locally