Multiple Domains + Multiple Webservers
-
My dad currently is hosting his website on port 80 and I'd like to host my own webserver on my computer.
Is it possible with pfsense to forward a specific domain to a specific local ip?
Example:
www.dadswebsite.com -> 192.168.0.22
www.mywebsite.com -> 192.168.0.33Thanks!
-
with the use of a reverse proxy sure..
Or using www.yourdomain.tld:81 or some other port as the dest port your clients connect to.. Then you can have pfsense forward that to a different IP on port 80 if you want.
-
Adding on to what johnpoz already noted, you can either:
-
Configure a reverse proxy using one of the packages on PFsense
-
Use port forwarding and host each site on a different port
-
Forward port 80 to a linux box, install squid, and configure squid as a reverse proxy
-
Host both sites on the web server and configure the server to listen for the host header instead of the IP
-
-
4 is how u would do it most of the time. But op clearly stated different webservers is why i didnt mention it. But it is how i would do it
Another option is get another public ip
-
Adding on to what johnpoz already noted, you can either:
-
Configure a reverse proxy using one of the packages on PFsense
-
Use port forwarding and host each site on a different and port
-
Forward port 80 to a linux box, install squid, and configure squid as a reverse proxy
-
Host both sites on the web server and configure the server to listen for the host header instead of the IP
5. Get more IP addresses.
-
-
If i may add to what my friend johnpoz and Derelict points,
Another approach to your situation is to bundle or configure both website to use only 1 server . Be it Apache/Lighttpd/Nginx/IIS can accept multiple domain on single IP address (regardless dynamic IP address or static IP address on WAN).
By doing that, you save multiple ports to port foward from pfsense to internal IP. All you need to do is to configure your dad website's and your website into a single machine (server) and write the Virtualhost blocks for the domain(s) that you want it inside the webserver software that you use. An A record on both of your domain control panel should point to your current WAN IP and thus the webserver will handle the domain(s) and points to the respective folder to serve files from.
Unless of course there's no other way around it and you have to use 2 machine (servers) then you will need to follow what johnpoz and Derelict pointed out in the previous post.
Regards
-
with everything that has been stated ….so in summarization...the follow is NOT possible with a SINGLE external IP address?
pfsense to forward a specific domain (SEPARATE servers to a specific local ip?)
Example:
www.dadswebsite.com -> 192.168.0.22
www.mywebsite.com -> 192.168.0.33.....without adding any reverse proxies, or add-on packages...
-
No, not possible with just standard NAT. The reason is that PF has no means to inspect the payloads of the data packets that are flowing trough the packet filter, to do redirections based on the destination hostname part of the HTTP headers you'd have to know what's inside those payloads.