Single Machine, multiple web servers, single IP Name -- How?

My ISSUE: I want to process incoming http URLs like http://myOneDomain.com/webserver1/xyz* requests such that all will be 'presented to/responded from' (rewritten, reverse-and-foward-proxied, port-forwarded? - I don't know which term is applicable to this approach or tools I need for this) to localhost:8081/xyz and for all http requests like http://myOneDomain.com/webserver2/xyz* requests to be presented to/responded from localhost:8082/xyz*, etc..

Maybe via nginx?- I don't know how to configure it to honor a "localhost:port_number" with which to do forward/reverse proxying.

Maybe via squid? (I have no experience yet with this-but will learn/investigate if needed)

maybe iptables? (I have no experience yet with this-will learn)

I have googled around, but have not hit on a combo of terms that leads me to a discussion of a similar issue or an answer.

Background/My Current Setup: In case I have not connected with the reader on my description of my issue, perhaps this background on what I am doing now will help clarify.

I have a linode to which I have root access and on which I have administered Ubuntu 10.04 , and I am comfortable installing new software.

This Linode has multiple webservers, eg webserver1 runs Drupal under apache2prefork instance, webserver2 runs Django under separate apache2 multithread-model instance, webserver3 runs xyz server running on someotherhttpd, all running on the one Linode Ubuntu 10.04 machine, where any given webserver/httpd process is the one and only 'listener' on a dedicated port number.

For example, webserver1 listens on port 8081, webserver 2 listens on 8082, … ad infinitum (I want to provide services using various webservers).

I have purchased multiple domain names.

I have set up nginx and the multiple instances of apache2 (with different threading models) such that requests to domainname1.com all go to webserver1, say listening on port 8081, and requests to domainname2.com all go to webserver2, and it works well.

However, this approach has disadvantages:

I have had to purchase and maintain registration on multiple IP domain names, and I want to save some administration money and hassle.

I'd rather tell users a single domain name to use and limit user confusion.

I want the webservers to interlink 'seamlessly' as far as the user is concerned, always showing the same IP name in the URL location field of their browsers (It's ok if a sub-path of the URL differs).

So - I want to go back to a single domain name.

Thanks for your tips! Maybe I just need another special term to apply in my google searching to find more info?

2 Replies

You want reverse proxying, nginx is probably your best bet. Here's a decent article

http://www.ubuntugeek.com/using-nginx-a … r-vps.html">http://www.ubuntugeek.com/using-nginx-as-a-reverse-proxy-to-get-the-most-out-of-your-vps.html

obs:

Thanks for the pointer! Works beautifully!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct