LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > Context and perl regexps

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2005, 10:52 AM
zellster zellster is offline
Senior Member
 
Join Date: Sep 2004
Posts: 55
Default Context and perl regexps

Hello,

I have the following context set up under LSWS SE 2.0.7:

[Proxy] "/" --> Java app server

I would like to selectively redirect certain directory paths to a different server, primarily for serving static content (LiteSpeed is acting as a firewall in this scenario).

I tried the following context:

[Proxy] exp:^/(css|img|ssi)/ --> Web server

Unfortunately, that Perl expression did not seem to work in that requests to http://myserver/css/my.css and others still go to the Java app server.

I then tried:

[Proxy] exp:^/(css|img|ssi)/.* --> Web server

which didn't produce the desired result, either. I am guessing that non-regexes are matched before regexes, which would always match against "/".

Other than using three separate contexts (/css/, /img/, /ssi/) is there a better way to do the above?

Thanks.
Reply With Quote
  #2  
Old 06-17-2005, 11:14 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
I am guessing that non-regexes are matched before regexes, which would always match against "/".
That's correct, explicit matching always takes place before regex matching. It is the current design.

Quote:
Other than using three separate contexts (/css/, /img/, /ssi/) is there a better way to do the above?
Noop, at this point.
Actually, it should be faster than using regex matching.
Reply With Quote
  #3  
Old 06-17-2005, 01:04 PM
zellster zellster is offline
Senior Member
 
Join Date: Sep 2004
Posts: 55
OK,

How does the regexp matching work? Supposed I changed the context URIs like the following:

[Proxy] exp:^/.* --> Java App Server
[Proxy] exp:^/(css|img|ssi)/.* --> Static content provider

Which order would LSWS attempt to match incoming requests? Is there a way to specify that the 2nd exp should be tried first?

Thanks...
Reply With Quote
  #4  
Old 06-17-2005, 01:21 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yes, you can specify the order of contexts from the admin interface by clicking the "+"/"-" sign in the sequence colume. Regex context with lower sequence number will be tried first.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:21 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.