on 03-Sep-201411:55 - edited on 05-Jun-202322:14 by JimmyPackets
Here's a quick LineRate proxy code snippet to convert an HTTP request to a HTTPS request using the embedded Node.js engine. The relevant parts of the LineRate proxy config are below, as well.
By modifying the
variable, you can redirect HTTP to HTTPS as well as doing a non-www to a www redirect. For example, you can redirect a request for
. The original URI is simply appended to the redirected request, so a request for
will be redirected to
This example uses the self-signed SSL certificate that is included in the LineRate distribution. This is fine for testing, but make sure to create a new SSL profile with your site certificate and key when going to production.