# configuration for running multiple servers on arbitrary hosts and # ports behind a nat box # # Problem: # You are running several machines behind a "nat", on the (unroutable) # network: 192.168.1. You wish to have several web servers, running # different hosts, or different ports on the same host all accessable # from the Internet. However, only one machine (the dmz machine) can # have port "80" port-forwarded to it. # # Solution: # - Use the "MultiHostHandler" to run multiple separate "virtual hosts" # from the single host visible to both the outside and the NAT (the dmz # host) # - Use the GenericProxyHandler to forward requests from the dmz host to # the machines behind the nat # # Notes: # - "passHost" causes the original "host" http header to be passed through # the "dmz" machine to the destination machine. With this enabled, # redirects within the destination machine still work properly. # (otherwise the request appears to come from the dmz machine) port=80 handler=multi multi.class=sunlabs.brazil.handler.MultiHostHandler multi.servers=pigs cows elephants # all requests to "pigs.homeip.net" will be routed to # 192.168.1.100:8080 pigs.host=pigs.homeip.net pigs.handler=pig pig.class=sunlabs.brazil.handler.GenericProxyHandler pig.host=192.168.1.100 pig.port=8080 pig.passHost=true # all requests to "cows.homeip.net" will be routed to # 192.168.1.110:8081 cows.host=cows.homeip.net cows.handler=cow cow.class=sunlabs.brazil.handler.GenericProxyHandler cow.host=192.168.1.110 cow.port=8081 cow.passHost=true # all requests to "elephants.homeip.net" will be routed to # 192.168.1.50:8080 elephants.host=elephants.homeip.net elephants.handler=elephant elephant.class=sunlabs.brazil.handler.GenericProxyHandler elephant.host=192.168.1.50 elephant.port=8080 elephant.passHost=true