View previous topic :: View next topic |
Author |
Message |
rigor n00b
Joined: 16 Jan 2006 Posts: 9
|
Posted: Mon May 16, 2011 2:40 pm Post subject: netfilter: redirecting based on URL |
|
|
Hi all,
I'm currently building a router based en Gentoo.
I want to filter (using layer7) incoming URLs. Like this example:
http://www.website-1.com (internet) ---> {my router} --> (192.168.1.10) internal webserver #1
http://www.other-website-2.com (internet) ---> {my router} --> (192.168.1.11) internal webserver #2
I know I need netfilter-layer7 and iptables.
I just dont know how to put them together to make the filtering happen.
Google dosent have much on this.
Any help or shared experiance would be appreciated.
thanks,
J-F |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23062
|
Posted: Tue May 17, 2011 12:26 am Post subject: |
|
|
It might be easier to use a reverse proxy than to use iptables. A reverse proxy will not preserve the original IP address as seen by the logs of the internal webserver, but it is probably less error prone to set up and use. If you could dedicate two public IP addresses to hosting, then you could use regular NAT, which would preserve the original IP address and be very easy to set up. |
|
Back to top |
|
|
rigor n00b
Joined: 16 Jan 2006 Posts: 9
|
Posted: Tue May 17, 2011 11:55 am Post subject: |
|
|
Thanks for the info.
I can see that it would be a mess and using multiple IPs would be better but for home use, when the ISP only give you 1 ip, then, something like this is needed
I'll look into a reverse proxy.
Thanks.
Rigor. |
|
Back to top |
|
|
|