LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-27-2009, 10:44 PM   #1
scubanarc
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Rep: Reputation: 0
Redirection in a bridge based on URL


Hey guys,

I have searched the forums and have been unable to find much info on how to implement redirection in a bridge based on HTTP URI.

We currently use a iptables to direct traffic based on IP address which allows us to do subdomain redirection, but we would really like to push the traffic from a subdirectory off to a different server.

For instance, it would be great to have all traffic go to a default server, but have the traffic for http://www.domain.com/subdir to go to a different server.

I am aware of squid, but it doesn't seem like it will perform very well on a high traffic site. I should mention that we are a high traffic site (couple millions hits / day) so performance is very important.

I also know that iptables can do string pattern matching inside the packet. Is this a good solution? Is this the fastest, performance wise, solution?

Any thoughts or contributions are greatly appreciated. I really would like to learn more about this topic.

- jason
 
Old 02-28-2009, 03:39 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well the normal method would be mod_proxy under apache, but if, as it'd assume, you're using a dedicated tier for the front end, try nginx to redirect and loadbalance http requests. LQ.org uses nginx quite prolifically and works really well. Things do get uglier with https of course...
 
Old 02-28-2009, 07:20 PM   #3
scubanarc
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Well the normal method would be mod_proxy under apache, but if, as it'd assume, you're using a dedicated tier for the front end, try nginx to redirect and loadbalance http requests. LQ.org uses nginx quite prolifically and works really well. Things do get uglier with https of course...
Cool, I'll look into nginx. It looks interesting, but not quite perfect.

We do have a dedicated tier, currently the server that all traffic comes in to is ONLY running iptables to do our load balancing. I'd like to run a service on that machine, preferably not a web server, that is capable of doing HTTP header inspection and redirection.

Perhaps I'm approaching this problem wrong and the solution is hard to find because there is a better way to do things. Here's our network layout:

Internet--> Dedicated iptables server (bridge) --> multiple HTTP servers

The iptables machine can load balance and route packets based on subdomains, but we'd like to have it route packets based on sub directory.

Any thoughts?

- jason
 
Old 02-28-2009, 08:13 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by scubanarc View Post
The iptables machine can load balance and route packets based on subdomains, but we'd like to have it route packets based on sub directory.

Any thoughts?
You're approaching it wrong. Every other device and product that performs this function does so as a proxy or a layer 3 (well, more like layer 5) router, not as a layer 2 bridge. If you want to do application inspection, you need to move further up the stack. Iptables is really not the right tool for this kind of task.

Last edited by chort; 02-28-2009 at 08:14 PM.
 
Old 03-01-2009, 03:12 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by chort View Post
You're approaching it wrong. Every other device and product that performs this function does so as a proxy or a layer 3 (well, more like layer 5) router, not as a layer 2 bridge. If you want to do application inspection, you need to move further up the stack. Iptables is really not the right tool for this kind of task.
quite substantially seconded. This is not what one does...
 
Old 03-02-2009, 01:30 AM   #6
scubanarc
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chort View Post
You're approaching it wrong. Every other device and product that performs this function does so as a proxy or a layer 3 (well, more like layer 5) router, not as a layer 2 bridge. If you want to do application inspection, you need to move further up the stack. Iptables is really not the right tool for this kind of task.
Quote:
Originally Posted by acid_kewpie View Post
quite substantially seconded. This is not what one does...
Ok, I'll definitely take any advice that you guys can give me in this regard. What are the names of some proxies, or layer 5 routers that I can use in this configuration.

Any advice that you can give me as to products that would function in the role that I have defined, preferably running on the same machine that is using iptables, and able to route to multiple HTTP servers.

I'm also not opposed to adding a dedicated proxy machine between the bridge and the HTTP servers, but that seems like an unnecessary step.

Thanks for all the help.

- jason
 
Old 03-02-2009, 02:52 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well we already have. apache or nginx. if you've $80,000 to spare a pair of F5 6800 LTM's would be quite nice too.
 
Old 03-02-2009, 10:59 AM   #8
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Or Cisco Content Switch, or Citrix NetScaler, or stuff from RadWare, Alteon, etc...

Why do you have a dedicated bridge box any way? That is the part that seems unnecessary. You could simply have a front-end tier that is a reverse proxy. I do not understand the obsession with having a bridge.
 
Old 03-02-2009, 11:48 PM   #9
scubanarc
LQ Newbie
 
Registered: Feb 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
well we already have. apache or nginx. if you've $80,000 to spare a pair of F5 6800 LTM's would be quite nice too.
Ah, I see. This is starting to make sense now.

I'm looking at the nginx docs, and it does look like it can do what I want it to do. I've also found a variety of reverse proxy examples online such as this one:

http://cognovis.de/developer/en/nginx-loadbalancing

I have not quite figured out how to setup my conf to do what I want. If any one has any experience with setting up nginx to load balance based on subdirectory name I'd sure appreciate some help.

- jason
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use squid for url redirection? GGlinux Linux - Software 2 02-24-2009 05:59 AM
URL based restrictions arsridhar Linux - Security 2 03-24-2008 01:36 AM
mod_rewrite url redirection sqn Linux - Software 2 10-04-2006 08:39 AM
redirection limit for this url is exceeded phpsharma Programming 3 07-16-2005 03:54 AM
url redirection/cookie problem tuxrules Linux - Newbie 3 07-13-2004 06:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration