LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2013, 06:27 AM   #1
HeloMe
LQ Newbie
 
Registered: Jan 2013
Location: Stockholm
Posts: 3

Rep: Reputation: Disabled
Proxy that route on file-suffix and domain?


Hi!

What application should I use as a proxy to route either to another proxy or send the request direct through based on the logic described in the function below?
(Can't find a more accurate way to describe it)

ProxyFunction(url)
{
if(url == *.jpg OR url == *.xml OR url == *.css)
return DIRECT
if(url == one.domainA.com OR url == two.domainB.com)
return DIRECT
if(url == domainA.com OR url == domanB.com)
return OTHER_PROXY
Return DIRECT
}

I plan to use it on my Synology NAS, so I'd prefer one of the applications available with ipkg, but I can download and compile (wget, configure, make, make install) myself if it is needed.

/BE
 
Old 01-24-2013, 03:17 AM   #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
Not a networking question. Moved to Linux - Software.

Your pseudo code is confusing, as this *looks* like a proxy.pac file. if this IS meant to be browser config then that's all possible with proxy.pac files certainly. If this is to perform some sort of service on a remote box, I'd say that mod_proxy on apache can do all of this, or nginx.

http://httpd.apache.org/docs/2.4/mod...proxypassmatch

Note that you'd want to use ProxyPreserveHost on the apache config so that when you send the traffic to a different proxy device, the original hostname will be there, not the hostname if the upstream proxy you specificy (or at least, that's likely to be what you want if I do understand your requirements)

EDIT _ and you can of course do this with a full web proxy, i.e. squid http://wiki.squid-cache.org/SquidFaq/SquidAcl with acls and cache_peer directives. Not sure how I managed to NOT mention squid...

Last edited by acid_kewpie; 01-24-2013 at 03:27 AM.
 
Old 01-24-2013, 04:35 AM   #3
HeloMe
LQ Newbie
 
Registered: Jan 2013
Location: Stockholm
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks, I'll look into those alternatives.

Yes, the behaviour source is a PAC-file, but the software needs to act as a server for my PS3 and iPad (Where PAC-files are not supported).

/BE
 
Old 01-24-2013, 05:27 AM   #4
HeloMe
LQ Newbie
 
Registered: Jan 2013
Location: Stockholm
Posts: 3

Original Poster
Rep: Reputation: Disabled
mod_proxy

Quote:
Originally Posted by acid_kewpie View Post
I'd say that mod_proxy on apache can do all of this
I've looked at http://httpd.apache.org/docs/2.2/mod/mod_proxy.html but not found any reference to configure NoProxy on file-suffix. Where can I find examples on that?

/BE
 
Old 01-24-2013, 05:57 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
tbh, squid really is the better option.

And I'm not sure you actually go "go direct" with mod_proxy. mod_rewrite would allow that certainly, as you can throw around variables much more easily. http://httpd.apache.org/docs/2.2/rew...ite_guide.html

But yeah.... squid first up.
 
  


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
[SOLVED] vimscript; remove file suffix with substitute() porphyry5 Programming 2 10-15-2012 09:38 AM
checking for suffix of object files... configure: error: cannot compute suffix of obj megras Linux - Kernel 1 10-15-2012 07:21 AM
Htaccess - Rewrite domain name suffix .re to upper case .RE guy974 Linux - Server 2 05-10-2012 05:05 AM
Default word processor (association with file suffix?) linuxbird Linux - Newbie 4 01-23-2011 11:34 AM
How to route my domain name to my server? benhalliday Linux - Software 9 08-17-2004 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:07 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