Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently have my Time Capsule to forward all inbound requests on port 80 to my Mac Mini which runs a web server with its local ip address of 192.168.1.8. I also have DNS set up so that if I go to example.com then it will send the request to my static public IP which will in turn cause the Time Capsule to forward the request on port 80 to my Mac Mini.

However I now have a Raspberry Pi on the local network also, with the ip address of 192.168.1.5. I want to be able to access the web server on the Raspberry Pi by going to pi.example.com, but I'm not sure how I can get the Time Capsule to port forward based on the domain. What I'd like to be able to have is something that works like this:

example.com:80       -->   public IP   -->    192.168.1.8:80
pi.example.com:80    -->   public IP   -->    192.168.1.5:80

Update

I've managed to do the above with Virtual Hosts and Forward Proxies in Apache. However that is just for HTTP on Port 80, how could I do this with other services such as SSH and FTP? Like:

example.com:21       -->   public IP   -->    192.168.1.8:21
pi.example.com:21    -->   public IP   -->    192.168.1.5:21
share|improve this question

1 Answer 1

You'll need an HTTP server acting as a proxy in order to forward based on the domain name. The Time Capsule is probably just doing NAT, and so isn't able to do this.

share|improve this answer
    
How exactly would I go about doing that? –  Joshua Mar 6 '13 at 22:34
    
Well I've managed to do that with Virtual Hosts and Forward Proxies in Apache now. However that is just for HTTP on Port 80, how could I do this with other services such as SSH and FTP? –  Joshua Mar 7 '13 at 19:10
    
@Joshua SSH and FTP don't have a concept of virtual hosts, so it can't be done at that level. You'll have to use different ports. –  mgorven Mar 7 '13 at 19:11
    
So for any other port other than 80 and I assume 443 it can't be done? –  Joshua Mar 9 '13 at 12:16
    
@Joshua It's the protocol which is relevant, not the port number. Most protocols don't have the concept of virtual hosts. –  mgorven Mar 10 '13 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.