title: How to reroute SFTP traffic via NGINX
body: <p>I'm trying to setup an FTP subdomain, such that all incoming SFTP requests to (say) ftp.myname.com, get routed to a particular internal server, (say) 10.123.456 via port 22.</p>
  
  <p>How do I use nginx to route this traffic?</p>
  
  <p>I've already setup the SFTP server, and can SFTP directly to the server, say:</p>
  
  <p>sftp username@123.456.7890, which works fine.</p>
  
  <p>The problem is that when I setup nginx to route all traffic to ftp.myname.com, it connects, but the passwords get rejected. I have no problems routing web traffic to my other subdomains, say dev.myname.com (with passwords), but it doesn't work for the SFTP traffic:</p>
  
  <pre><code>server {
      listen 22;
      server_name ftp.myname.com;
      return .............
  }
  </code></pre>
  
  <p>How do I define the return sting to route the traffic with the passwords? </p>
  
  <p>The connection is SFTP (via port 22).</p>
  
  <p>Thanks</p>