# Forward port 80 requests to jail?



## cwhitmore (Apr 19, 2009)

I have a cheap linksys router that will do port forwarding. That works great for one website/domain on my FreeBSD 7.1 system, but I've setup a jail with another website and different domain. How can I redirect requests to this second domain from within FreeBSD?


----------



## SirDice (Apr 19, 2009)

You can't. I'm assuming you only have one public Internet IP address. You cannot forward the same port to different machines. The only way to do it is to forward some other port, i.e. 81, to your second website.

Another way to do it is to set up one apache server that serves two name based virtual hosts. Both domainnames will point to the same IP address. This of course means both websites need to be served from the same host or jail.


----------



## vivek (Apr 19, 2009)

Another option is setup ngnix or lighttpd on main host and then redirect all requests to different jail or hosts with one public IP.


----------



## cwhitmore (Apr 20, 2009)

vivek,
I looked at ngnix and lighttpd. It looks like lighttpd is in the port collection, but I couldn't find much documentation on it. I'm assuming I'll install this on the host? Can you provide some help or redirect me to some docs? Thanks.


----------



## vivek (Apr 20, 2009)

You need to setup reverse proxy. You can google it as "lighttpd reverse proxy" or "ngnix reverse proxy".


Lighttpd specific info: http://redmine.lighttpd.net/projects/1/wiki/Docs:ModProxyCore
ngnix specific info: http://wiki.nginx.org/NginxHttpUpstreamModule

Another highly recommended option is pound.

HTH


----------



## cwhitmore (May 12, 2009)

Pound looks like something I can use, but I can't find much in the way of config examples. I looked in the man pages, but need some help. 
I want to serve 2 websites (on from FreeBSD host and one is a jail). 
Can someone send me some examples for this?
thanks


----------

