reverse proxy scenario?

#1
Hello,

I am interested in using litespeed as a reverse proxy for an amazon s3 storage bucket.

I have a few questions and would like to know if this is possible:

- Is it possible to do url rewrite before passing the query to the destination server? For example: have sub.domain.com/folder/file.html go to domain.net.s3.amazonaws.com/folder/file.html

- Is it possible to do any work on certain responses from the destination server? For example, when a certain response occurs, I dont want to show the response from amazon, but my own customized view.

Thanks,
 

mistwang

LiteSpeed Staff
#2
The first one is possible with rewrite rule which can change the domain name.

The second one probably is no, because LSWS sends the response body as is.
 

mistwang

LiteSpeed Staff
#5
Like,
Code:
RewriteRule ^/(folder/file.html)$ [URL="http://adc.zoznam.sk//printenv.cgi"]http://doamin.net.s3.amazonaws.com/$1[/URL] [P,E=Proxy-Host:domain.net.s3.amazonaws.com]

The value of environment "Proxy-Host" is the target domain name,
this rule only works with Enterprise edition, standard edition is not capable of changing the domain name based on "Proxy-Host" env.

The domain part of the target URL http://doamin.net.s3.amazonaws.com is used to match the proxy external app's name, so it can be any name you used to define the external app, do not have to be match the target domain name.
 
#6
Thanks, that seem to have done the job.

Any feedback on the ability to modify output from the application server based on certain matches on the header/content? Is this functionality built in LSW or would it be possible to build a SAPI filter that would do that?
 

mistwang

LiteSpeed Staff
#9
LiteSpeed does not have the infrastructure in place to manipulate the response, just send it as is.

It is possible to implement something with an external LSAPI filter, but it is not efficient.
 
Top