|
|

03-20-2013, 06:32 PM
|
|
Member
|
|
Join Date: Mar 2013
Posts: 38
|
|
Its a trial I downloaded 2 days ago. Version 4.2.2 Ent for 2 CPU Expiration Apr 02, 2013 
gdewey@ubuntu:/etc/network$ ls -lt /usr/local/lsws/bin/lshttpd*;date;date -u
lrwxrwxrwx 1 root root 15 Mar 18 22:33 /usr/local/lsws/bin/lshttpd -> ./lshttpd.4.2.2
-r-xr-xr-x 1 root root 11956833 Mar 18 22:33 /usr/local/lsws/bin/lshttpd.4.2.2
Wed Mar 20 19:30:17 CST 2013
Thu Mar 21 01:30:17 UTC 2013
one question.. the rewrite/proxy does change the links to the front end VH right? (regardless I might be having a bad config or something)..
|

03-20-2013, 07:31 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
|
the rewrite/proxy has been working for long, and I've done many tests on this function in the past. I'd share more experience after you've got it working, for example, how to get it working with cache in rewriterule.
please check if you've defined proxy context at the same time.
if so, best to delete them to reduce conflict. forgot to ask, if the virtual host defined in lsws admin console(i.e., native vhost) or come from apache's httpd.conf ?
|

03-20-2013, 08:42 PM
|
|
Member
|
|
Join Date: Mar 2013
Posts: 38
|
|
Quote:
Originally Posted by NiteWave
the rewrite/proxy has been working for long, and I've done many tests on this function in the past. I'd share more experience after you've got it working, for example, how to get it working with cache in rewriterule.
please check if you've defined proxy context at the same time.
if so, best to delete them to reduce conflict. forgot to ask, if the virtual host defined in lsws admin console(i.e., native vhost) or come from apache's httpd.conf ?
|
Hi Nite, if I defined the context at the same time as what? or where else?
Virtual Host was created in the admin console. Does not come from apache.
|

03-20-2013, 09:25 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
|
for example in your case, if you define a proxy context which URI is /, then your all your rewriterules should be useless, whether they are parsed or not.
enable debug log and rewrite log, you can see the details how there rules are processed and what's the final result.
debug log:
admin console->Actions->Toggle Debug Logging
rewrite log:
select a vhost->Rewrite->Enable Rewrite:Yes; Log Level:9
|

03-20-2013, 09:29 PM
|
|
Member
|
|
Join Date: Mar 2013
Posts: 38
|
|
|
yes that is my case. proxy context is / .. so how do I set rewrite rules for this type of context so they apply to it?
let me enable the logs to tail them while testing
|

03-20-2013, 09:33 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
Quote:
|
how do I set rewrite rules for this type of context
|
this rewriterule do same as proxy / context:
RewriteRule (.*) http://VanguardiaWeb/$1 [P]
but don't use them at the same time. use either one.
|

03-20-2013, 09:44 PM
|
|
Member
|
|
Join Date: Mar 2013
Posts: 38
|
|
|
ok understood. I took the rule out and tested also disabled the rewrite engine but no luck. still the backend site gives links as original.
there is one thing that I belive it might be affecting
the proxy is calling the back end server with an ip..
but the backend server has a rewriter that sets a hostname ..
would it be possible that the match of the rewrite is not being done because the lsws belives the match is the ip and not the rewriten host on the backend?
|

03-20-2013, 10:07 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
please refer:
https://store.litespeedtech.com/stor...yarticle&id=21
about "Proxy-Host"
for your case:
RewriteRule (.*) http://VanguardiaWeb/$1 [P,E=Proxy-Host:www.example.com]
however, if frontend and backend server's domain name are same, you don't need set Proxy-Host.
Last edited by NiteWave; 03-20-2013 at 10:09 PM..
|

03-20-2013, 10:09 PM
|
|
Member
|
|
Join Date: Mar 2013
Posts: 38
|
|
this one fits perfect
RewriteRule ^(.*)$ http://node1/$1 [P,E=Proxy-Host:www.example.com]
from what I understand I can set a custom host regardless the target server host.
The problem is that I am on the / context and cannot use ReWrite rules as you mention.. I tried that rule before but didn't took any effect 
any ideas to keep the / context and still be able to set rewrite rules?
|

03-20-2013, 10:20 PM
|
|
LiteSpeed Staff
|
|
Join Date: Sep 2009
Posts: 2,218
|
|
|
I encountered exact same issue as you before ... you can keep other context like /abc/ at the same time but can't keep context / since it matchs everything.
and in rewriterule you can do almost everything which a contect can, and, in context, no such "Proxy-Host" function yet, so any special requirement which must use context ?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:12 PM.
|
|