Bobcares

OpenLiteSpeed Reverse Proxy | Set-up Guide

by | Sep 19, 2023

Learn how to set up OpenLiteSpeed as a reverse proxy. Our Server Management Support team is here to help you with your questions and concerns.

How to set up OpenLiteSpeed as a Reverse Proxy

OpenLiteSpeed is a powerful web server. It can be configured as a transparent reverse proxy for different backend web servers and application servers that support HTTP.

openlitespeed reverse proxy

Today, we are going to look at how to set up OpenLiteSpeed as a reverse proxy.

  1. First, we have to create a web server external application. This will define the backend server that OpenLiteSpeed will proxy requests to. To do this, we have to head to Server Configuration > External App > Add > Type > Web Server.
  2. Then, we have to configure the backend server to listen to a specific address and port.
  3. Now, we must decide which traffic to send to the external application via rewrite rules, contexts, or script handlers.
    • Method 1: Proxy with Context:

      First, head to WebAdmin console > Virtual Hosts > Your Virtual Host > Context > Add > Type > Proxy. Then, define the URI we want to proxy.

    • Method 2: Proxying with Script Handlers

      First, we have to access the WebAdmin console and head to Server Configuration or Virtual Hosts > Your Virtual Host > Script Handler > Add. Then, configure the script handler to route requests with a certain suffix to the web server external application.

    • Method 3: Proxying with Rewrite Rules

      First, we must create a new virtual host for the site we want to proxy to be heading to WebAdmin console > Virtual Hosts > Add. Then, add a rewrite rule to the virtual host configuration to send traffic to the proxy external application.

      For IP-based virtual hosting:


      REWRITERULE ^(.*)$ HTTP://apache:8080/$1 [P]

      For name-based virtual hosting:

      RewriteCond %{HTTPS} !=on
      REWRITERULE ^(.*)$ HTTP://apachehttp/$1 [P,L,E=PROXY-HOST:WWW.EXAMPLE1.COM]
      RewriteRule ^(.*)$ HTTPS://apachehttps/$1 [P,L,E=PROXY-HOST:WWW.EXAMPLE1.COM]

  4. Now, we have to head to Listeners > Your Listeners > Virtual Host Mappings > Add.
  5. Then, choose the proxy virtual host and mention the domain we want.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In brief, our Support Techs demonstrated how to set up OpenLiteSpeed as a reverse proxy.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.