Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up a Gitlab server (https://about.gitlab.com/) inside a virtual machine using KVM on a Ubuntu 14.04 host. My university charges us for every external IP address, so I cannot use bridged networking and have each virtual machine talk to the outside world directly. Instead, I have to use NAT and the host machine has to handle all the inbound traffic.

For HTTP, this is no big problem. I set up a reverse proxy using Nginx and dnsmaq to direct traffic based on the subdomain (e.g. git.example.com will go to the Gitlab server). But the Gitlab server also needs inbound SSH connections for git to work. I got as far as to figure out that Nginx only seems to provide reverse proxying for HTTP/S connections and I can't use it for SSH. It is also important that the Gitlab server is available on port 22, because otherwise all users would have to be instructed to use a different port.

Does anybody know whether I can use Apache with mod_proxy for this or another solution? The ideal setup would direct SSH traffic based on the subdomain such that ssh example.com goes to the host, ssh git.example.com goes to the git server, etc.

share|improve this question
    
ssh connects to IP:port, there is no hostname in request to distinguish example.com and git.example.com if they have the same IP. – Alexey Ten Jul 31 '14 at 11:11
    
Yeah - thanks. I realize the SSH protocol is quite different from HTTP, so I will probably just have to do with routing based on the port. – oceanhug Jul 31 '14 at 23:07
1  
see my work github.com/tg123/sshpiper – farmer1992 Dec 29 '14 at 17:00

You must log in to answer this question.

Browse other questions tagged .