Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Linux http request forwarding
Name: Gerrit Giliomee Date: October 2, 2002 at 11:56:56 Pacific OS: Redhat 7.3 CPU/Ram: 366MHz - 256Mg
Comment:
I'm running my linux box as a firewall/web server & have a couple of windows boxes on the inside that connect to the internet using the linux box as the gateway. The Linux box is running apache and serving up a couple of html/php sites. However one of my flatmates is developing in .NET on one of the internal boxes & he wants to have the site he's doing available to the outside world, so I want to set up the linux box to check the http header & forward certain headers to his box so the pages are served up from his box via the Linux box. Is that possible? Does this all make sense? I've looked at port forwarding & that's not going to cut it cause I want the Linux box to serve up some of the port 80 request and the NT box to serve up some others...
Name: dwp Date: October 2, 2002 at 12:16:48 Pacific
Reply:
I assume you are running Apache on Linux, if so read about Virtual Hosts.
0
Response Number 2
Name: Danny Larouche Date: October 2, 2002 at 20:34:22 Pacific
Reply:
You need to use "rewriting rules"
Based on predefined conditions, http request may be modified or forwarded.
However, as i read, you don't really want or can forward requests to the other server directly, but rather use the linux server as web proxy, right?
You may the create a rewriting-rules that direct all request for page within a directoty to a cgi. this Cgi script may use wget to retreive the page on .NET server and serve it.
Summary: I have several examples of ip masquerading and port forwarding at http://krnlpanic.com . If you're running a 2.2.x kernel, you need to use ipchains, for a 2.4.x kernel, iptables. If you're using ipta...
Summary: What type of router are you using. What are you using as your DHCP server? Why don't you use your router for DSL access, DHCP server, and router? What are you planning on having the router route to? A...
Summary: Need to forward http requests through my firewall on port 81 to an internal webserver on port 80... Would this do it??? iptables -t nat -A PREROUTING -p tcp -d $EXT_IP --dport 81 -j DNAT --to 90.0.0.3...