Printable Version | Subscribe | Add to Favourites
New Topic New Poll New Reply
Author: Subject: Reverse proxy configuration
Slimy38

posted on 14/7/14 at 01:29 PM Reply With Quote
Reverse proxy configuration

Anyone know anything about configuring a reverse proxy? I want to set up a website that is basically a collection of third level domains under a single URL, but I want to have a single box set up as public facing, that then each third level domains routes the traffic to a different IP address and port in my local network.

So for example;

www.1.slimy.co.uk would route to http://192.168.0.1:80
www.2.slimy.co.uk would route to http://192.168.0.5:8080
www.3.slimy.co.uk would route to http://192.168.0.10:8888

with all domains routing to a single public facing address, and assume all HTTP traffic (despite the port changes).

Apologies if what I'm thinking about isn't possible, if I have to do it another way then I'd appreciate any input.

[Edited on 14/7/14 by Slimy38]

View User's Profile View All Posts By User U2U Member
jeffw

posted on 14/7/14 at 01:39 PM Reply With Quote
It can certainly be done. Most forward proxies will do it in reverse like this.

What are you going to use?






View User's Profile View All Posts By User U2U Member
jeffw

posted on 14/7/14 at 01:42 PM Reply With Quote
www.1.slimy.co.uk would route to http://192.168.0.1:80
www.2.slimy.co.uk would route to http://192.168.0.5:8080
www.3.slimy.co.uk would route to http://192.168.0.10:8888

Not sure why you are changing IP and port numbers for the inside addresses. One or the other.

You could do Port Address Translation or do Reverse Proxy






View User's Profile View All Posts By User U2U Member
Slimy38

posted on 14/7/14 at 01:55 PM Reply With Quote
quote:
Originally posted by jeffw
www.1.slimy.co.uk would route to http://192.168.0.1:80
www.2.slimy.co.uk would route to http://192.168.0.5:8080
www.3.slimy.co.uk would route to http://192.168.0.10:8888

Not sure why you are changing IP and port numbers for the inside addresses. One or the other.

You could do Port Address Translation or do Reverse Proxy


this is only a sample of the routes, some boxes share tasks so I could also have;

www.4.slimy.co.uk would route to http://192.168.0.10:6666

They're hosting different software applications that are all web based, all have configurable ports but not all can live on the same box. I suspect in reality I'll use up port 80 on all IP addresses first, then maybe 81, 82 etc depending on how many I need on each box.

As for software, I've just been looking at the mod_proxy options with Apache.

Thanks for the quick response.

View User's Profile View All Posts By User U2U Member
GreigM

posted on 14/7/14 at 02:36 PM Reply With Quote
was just going to post that Apache and mod_proxy is what you're looking for - once you get your head round the manual its really quite simple to use
View User's Profile View All Posts By User U2U Member
jeffw

posted on 14/7/14 at 02:51 PM Reply With Quote
It is just a matter of tying the listener Ports/addresses to the URLs, easy enough in F5 or Bluecoat, not done it in Apache for many years.






View User's Profile View All Posts By User U2U Member
ironside

posted on 16/7/14 at 05:26 PM Reply With Quote
Apache/mod_proxy will do this for you. You'll need to enable name-based virtual hosting with:

code:
NameVirtualHost *:80


Then create a VirtualHost entry for each of site names such as:

code:

<VirtualHost *:80>
ServerName www.1.slimy.co.uk
ProxyPass / http://192.168.0.1/
ProxyPassReverse / http://192.168.0.1/

CustomLog logs/www.1.slimy.co.uk-access.log combined
ErrorLog logs/www.1.slimy.co.uk-error.log
</VirtualHost>

<VirtualHost *:80>
ServerName www.2.slimy.co.uk
ProxyPass / http://192.168.0.5:8080/
ProxyPassReverse / http://192.168.0.5:8080/

CustomLog logs/www.2.slimy.co.uk-access.log combined
ErrorLog logs/www.2.slimy.co.uk-error.log
</VirtualHost>



And so on . . .

[Edited on 16/7/14 by ironside]

View User's Profile View All Posts By User U2U Member
Slimy38

posted on 16/7/14 at 06:01 PM Reply With Quote
Awesome! Now all I need to do is figure out how to do the same with UDP... turns out one of the apps uses UDP rather than TCP.
View User's Profile View All Posts By User U2U Member
ironside

posted on 16/7/14 at 06:11 PM Reply With Quote
Mind that will only work for HTTP (and HTTPS), not any TCP application.
I assume it's not HTTP over UDP - is that even a thing?

[Edited on 16/7/14 by ironside]

View User's Profile View All Posts By User U2U Member
jeffw

posted on 16/7/14 at 09:36 PM Reply With Quote
You are going to have to do NATing and not reverse proxy.






View User's Profile View All Posts By User U2U Member

New Topic New Poll New Reply


go to top






Website design and SEO by Studio Montage

All content © 2001-16 LocostBuilders. Reproduction prohibited
Opinions expressed in public posts are those of the author and do not necessarily represent
the views of other users or any member of the LocostBuilders team.
Running XMB 1.8 Partagium [© 2002 XMB Group] on Apache under CentOS Linux
Founded, built and operated by ChrisW.