CyberPanel Community

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

qt
qtwrk #1

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.

28 replies
Ka
Kaz #5

U can use sub domain…

lt
lth8284 #6

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.

Ka
Kaz #7

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]

Ch
Chlitzxer #8

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

qt
qtwrk #9
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 ?

Ch
Chlitzxer #10
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.

px
pxnji #13

Can i use reverse proxy between Cyberpanel?

qt
qtwrk #14

why not ?

px
pxnji #15

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

qt
qtwrk #16

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

w3
w3services #17

Query -

In this case where SSL will install?

On apache or openlitespeed ?

qt
qtwrk #18
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

w3
w3services #19

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.

qt
qtwrk #20

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

ja
jackpete #21

Can I do multiple of this in the same server?

I have hosted multiple domains on the same OpenLiteSpeed server using CyberPanel

Let’s say I have hosted one.abc.com and two.abc.com using CyberPanel. If relevant, my server hostname is panel.abc.com.

Now, I want to use one.abc.com as reverse proxy for one.xyz.com.
And, two.abc.com as reverse proxy for two.xyz.com.

If it can be done then can you please tell me how I can do this?

qt
qtwrk #22

yes , you can do multiple proxy , just repeat above process

D4
D4V1B04G35 #23

In my console don’t have the option context. whats should i do?

sa
sailorrr #24

But may I ask: what the reason of doing this (OpenLiteSpeed as Reverse Proxy server)?

id
idmun #25

Hello,

Will this apply for an external public IP:PORT?

I’m trying to access an internal web server by mapping the public IP and port to a subdomain with openlitespeed and cyberpanel.

I am unable to make it work.

Can you please point me to where I can accomplish this?

Thank you very much.

Ed

Kr
Kruzifix #26

I am stuck on step 2 as I can’t find the GUI that has the External App tab. Is OpenLightSpeed different from CyberPanel web hosting panel?

NK
Nitesh Kunnath #27

To view your openlitespeed settings, you need to visit your IP address:7080
for example, if your ip address is 192.0.12.1 then you need to enter this in your web browser : http://192.0.12.1:7080 to access Openlitespeed webserver interface.

rs
rssperky #29

Have anybody settings for multiple servers? Not loadbalancing, I want use it like Varnish cache system front of 5 VPS.

Sign in to reply