[Tutorial] How to use OpenLiteSpeed as Reverse Proxy server.

Hi, this guide will show you how to setup OpenLiteSpeed as reverse proxy server.

In this example , I will use backend.cyberpanel.net as back-end , and reverse.cyberpanel.net as front-end.

  1. First of all , test both domains are working


  1. Now go to External App , create a new external app type “Web Server”

  1. Let’s call it “Backend” , this name will be used in later step.

In this case , it’s same machine , so it is 127.0.0.1 , if it’s different server , you can set public IP , if backend is HTTPS , remember add https://

  1. Now create a context, type “Proxy”, set URI to /



  1. Since it’s different domain , you also have to pass hostname for backend to accept request.

RewriteRule ^/(.*)$ http://backend/$1 [P,E=Proxy-Host:backend.cyberpanel.net]`

note: backend is the name you created in step 3, and backend.cyberpanel.net is our back-end domain.

  1. Now let’s restart OpenLiteSpeed and test it.

can i use this method to point “mydomain.com:8090” to panel.mydomain.com?

can i use this method to point "mydomain.com:8090" to panel.mydomain.com?
can i use this method to point "mydomain.com:8090" to panel.mydomain.com?

How to remove port 8090 from CyberPanel - CyberPanel

thank you!
but it looks like a new domain like panel.mydomain.com not subdomain right?

U can use sub domain…

i do not understand.
okay i have a domain abc.com
now i want to use cyberpanel as subdomain like panel.abc.com which is SSL. what can i do? can you give step by steps?
and next i wanna use mail, forum, ftp as subdomain like mail.abc.com. how can i config like panel as subdomain.

1 Create a new site panel.abc.com
2 Issue ssl
3 Access ssh (putty)
4 Open /usr/local/lsws/conf/httpd_config.conf
Paste the following

extprocessor cyberpanel {
type proxy
address https://panel.abc.com:8090
maxConns 100
pcKeepAliveTimeout 60
initTimeout 60
retryTimeout 0
respBuffer 0
}
4. Add rewrite rules
REWRITERULE ^(.*)$ HTTP://cyberpanel/$1 [P]

How can I achieve this with the same domain using 2 different servers?

How can I achieve this with the same domain using 2 different servers?

what do you mean ? proxy to 2 servers on same domain , like load balancer ?

How can I achieve this with the same domain using 2 different servers?

what do you mean ? proxy to 2 servers on same domain , like load balancer ?

Correct, like a load balancer.

like this maybe ?

like this maybe ?

Get OpenLiteSpeed Help with the Knowledge Base • OpenLiteSpeed

Thanks!

Can i use reverse proxy between Cyberpanel?

why not ?

so should i setting it through OpenLiteSpeed webadmin console, right? or it can be done through cyberpanel?

If you want to reverse proxy something, you have to set it up in Webadmin

Query -

In this case where SSL will install?

On apache or openlitespeed ?

Query -

In this case where SSL will install?

On apache or openlitespeed ?

you can install on both place if you want to communication between OLS and Apache to be HTTPS

otherwise , on OLS , as it faces in front

One more issue - How to put OLS in front for apache? When we do apache not starting and always getting error like

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:82

I checked many times this port is not in use but still error comping and apache not starting.

Tried putting
sudo setenforce 0

But no luck.

you need to confirm the port with netstat command
if you server doesn’t have ipv6 , then you need to comment out ipv6 bind