[Users] Simple HTTP proxy for sharing a port on the HN?

Sergej Kandyla sk.paix at gmail.com
Wed Dec 15 09:57:17 EST 2010


Benjamin Henrion wrote:
> Hi,
>
> I want to host 3 different webservers into 3 different containers, but
> I have only one public IP on the Hardware node.
>
> Does anybody has a simple config of apache in mod_proxy or lighttpd?
>   

With nginx (or lighttpd) this a quite trivial task.
Moreover, I would recommend using nginx instead of apache due to 
performance reasons.
And actually I'm using such setup, to proxing  not only to VE, but from 
one IP of company's 
gate server to  different internal servers with non real IPs.



## on node with real ip:

http {
    # all default parametrs
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    ...
}


server {
        listen     80;
        server_name sample1 www.sample1;
        access_log  /var/log/nginx/sample1.access.log  main;

        location / {
            proxy_pass              http://192.168.x.x:8080;
        }
}

server {
        listen     80;
        server_name sampleN www.sampleN;
        access_log  /var/log/nginx/sampleN.access.log  main;

        location / {
            proxy_pass              http://192.168.x.N:80;
        }
}

....
server {
        listen     443;
        server_name sample1 www.sample1;
       
        ssl                  on;
        ssl_certificate      ssl/cert.pem;
        ssl_certificate_key  ssl/cert.key;

        access_log  /var/log/nginx/sample1.ssl.access.log  main;

        location / {
            proxy_pass              https://192.168.x.x:443;
        }
}





More information about the Users mailing list