From: kashani <kashani-list@badapple.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] OT: iptables w/ 2 web servers
Date: Wed, 23 Sep 2009 14:49:26 -0700 [thread overview]
Message-ID: <4ABA97E6.2070505@badapple.net> (raw)
In-Reply-To: <loom.20090923T232252-112@post.gmane.org>
James wrote:
> Hello,
>
> I have one static IP with DNS (primary and secondary)
> performed by my isp. I'm setting up a second web server
> with a different domain name. It is setup already by the ISP
> for DNS. Could someone post
> some simple iptable examples of how to route 2 different
> web server traffic streams to 2 different machines?
>
> Both are inside the same DMZ....2 different machines
> with different (NAT) IP addresses.
>
> Right now, all port 80 traffic is auto forwarded to
> a single NAT address on the firewall. Simple. Now I have
> to figure out how to forward different web traffic streams
> to 2 different NAT ip addresses, each on a different ip
> address and a different machine.
>
> I do not want to put the sites on the same machine, for a variety
> of reasons, beside one machine moves in a few months to a
> different physical location (and network numbers).
>
> Suggestions or a good book for example would be keen.
> I use raw IPtables/netfilter on the firewall. All servers
> are gentoo.
I'm not sure it's possible via firewall rules because they are
operating at the IP level and you'd really need to be doing deep looks
into the packets to read the http request headers in order to figure out
which server should be getting the connection.
The simplest solution is to run a reverse proxy on your firewall that
actually accepts the http connection, reads the http request, and then
forwards it on to the correct web server. You can do this in apache via
proxypass, Squid which is your most powerful and flexible option, ngnix,
lighttpd, or Varnish.
There are some security concerns with this type of setup, ie running
daemons open to the public on your firewall, reverse proxies need to be
locked down, hard to do IP based restrictions on the webserver, etc.
kashani
next prev parent reply other threads:[~2009-09-23 21:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-23 21:35 [gentoo-user] OT: iptables w/ 2 web servers James
2009-09-23 21:49 ` kashani [this message]
2009-09-24 3:48 ` Stroller
2009-09-24 15:30 ` [gentoo-user] " James
2009-09-24 16:58 ` kashani
2009-09-24 17:58 ` Stroller
2009-09-25 12:40 ` Etaoin Shrdlu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ABA97E6.2070505@badapple.net \
--to=kashani-list@badapple.net \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox