Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-22-2013, 06:27 AM
|
#1
|
LQ Newbie
Registered: Jan 2013
Location: Stockholm
Posts: 3
Rep: 
|
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
|
|
|
01-24-2013, 03:17 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
01-24-2013, 04:35 AM
|
#3
|
LQ Newbie
Registered: Jan 2013
Location: Stockholm
Posts: 3
Original Poster
Rep: 
|
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
|
|
|
01-24-2013, 05:27 AM
|
#4
|
LQ Newbie
Registered: Jan 2013
Location: Stockholm
Posts: 3
Original Poster
Rep: 
|
mod_proxy
Quote:
Originally Posted by acid_kewpie
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
|
|
|
01-24-2013, 05:57 AM
|
#5
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
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.
|
|
|
All times are GMT -5. The time now is 05:12 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|