0

is nginx capable of such a proxy: user to nginx uses SSH; nginx to backend server uses TCP. So far, I have found a solution like the following, but it is said to only proxy SSH to SSH.

worker_processes 1;
events {
    worker_connections 1024;
}
stream {  
    upstream ssh {
        server 192.168.4.102:80;
    }
    server { 
        listen 80;
        proxy_pass ssh;
        proxy_connect_timeout 1h;
        proxy_timeout 1h;
    }
}
Tiina
  • 2,920
  • 3
  • 17
  • 26
  • What? SSH is an application layer protocol; TCP is a transport layer protocol. SSH can use TCP and usually does (because TCP/IP is so common). There is a number `80` in your solution, so maybe it's about HTTP. Do you want to use SSH to tunnel HTTP traffic? If so, please see [how to create a SOCKS proxy with `ssh`](https://superuser.com/q/1308495/432690) (except you want the remote computer to be a proxy). – Kamil Maciorowski Feb 17 '19 at 00:44
  • @KamilMaciorowski >.< right! Thanks for reminding. I was looking for nginx proxy from ssh to tcp, and shocked that both official website and tutorials never mentioned. Now I see why! – Tiina Feb 17 '19 at 01:56

0 Answers0