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

Go Back   LiteSpeed Support Forums > LiteSpeed Load Balancer > General > switching from nginx to LSLB

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2009, 03:19 AM
Clockwork Clockwork is offline
Senior Member
 
Join Date: May 2009
Posts: 74
Default switching from nginx to LSLB

Hello,

I would like to switch from nginx to lslb, but I need help with the configuration

I'm currently using this nginx configuration:

Code:
  upstream xyz {
    server 192.168.0.4 weight=5;
    server 192.168.0.3 weight=3;
    server 127.0.0.1:81 weight=1;
  }

  server { # simple reverse-proxy
    listen       80;
    server_name  www.xyz.com;

    # upload fix
    client_max_body_size 12m;

    # serve static files
    location ~ /(images|customavatars|customprofilepics|customgroupicons|signaturepics|albums|attachments|clientscript|iconimages|vbulletin_css|vbseo_sitemap)/  {
      root    /var/www/xyz/httpdocs/forum;
      proxy_pass      http://127.0.0.1:81;
    }

    # sitemaps
    location ~ /sitemap_ {
      root    /var/www/xyz/httpdocs/forum;
      proxy_pass      http://127.0.0.1:81;
    }

    # pass requests for dynamic content to rails/turbogears/zope, et al
    location / {
      proxy_pass      http://xyz;
    }
I've just did this tutorial: http://www.wowtutorial.org/tutorial/80.html

but there isn't mentioned how to use the "Content aware: route request based on request content" feature.
Reply With Quote
  #2  
Old 09-17-2009, 10:03 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
From your nginx configuration, I guess you want to route requests based on URL.

For sitemap and static file, create a cluster with one member 127.0.0.1:81, then create a regex matching context, use that cluster as handler.

Create a cluster with members 192.168.0.4,192.168.0.3,127.0.0.1:81, use it as default cluster.
Reply With Quote
  #3  
Old 09-17-2009, 10:28 AM
Clockwork Clockwork is offline
Senior Member
 
Join Date: May 2009
Posts: 74
could you give me an example screenshot on that context thingy? or a link to the documentation?

Last edited by Clockwork; 09-17-2009 at 10:44 AM..
Reply With Quote
  #4  
Old 09-17-2009, 02:52 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
For online help, please click the "Help" link in the web console, then go to "Configuration"->"Context"

It is very simple if you familiar with our web server admin console.
Just like a proxy context for web server.
The URI should be like

Code:
exp: ^/(images|customavatars|customprofilepics|customgroupicons|signaturepics|albums|attachments|clientscript|iconimages|vbulletin_css|vbseo_sitemap)/
You can combine it with '~ /sitemap_' or create another context for it, just like the nginx configuration.
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 04:33 PM.



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