Good day. The task is as follows - there is a server with a white IP on which the ssh-server is spinning, for example, called server.net, a single port is open on it, for example 10030, how to organize the ability to forward reverse tunnels from several clients to this single port. There is no problem with one client "ssh -f -N -R 10030: localhost: 80 user@server.net", but if there are two clients, then ssh informs you that the port is busy and does not allow you to open the tunnel. The question is how to avoid this limitation, are there any such methods?
1 answer
if, as it turned out in the discussion, you need to “dissolve into different directions” http-traffic , then it is more logical to use some http-proxy server (for example, nginx ).
which, depending on the host: http header , will redirect the client's http request to the computer you specify.
Clients with their http servers can forward tunnels to unique local ports on the server. and nginx will proxy connections to these local ports.
An indicative example of a nginx configuration for the domain.name domain and the local port 2001:
server { server_name domain.name; location / { proxy_pass http://127.0.0.1:2001; ... } - I'm afraid the problem is a bit more complicated there, their servers do not have their own real ip and then collect them on the proxy server. But your link is useful, because, for example, I did not know the settings for nginx, and he would need it anyway. Although there was something about the subdomains said, you may need to proxying by domain names - Mike
- clients can forward tunnels to unique local server ports. and nginx will proxy connections to these local ports. you may need proxying by domain names - by dns-names http-proxy usually distinguishes connections, and this or that section in the configuration “works”. - aleksandr barakin
- Yes, that is what I meant by "a little harder." Just in that article there is a redirect to the location, does it also imply the domain name? If yes, then no problem, if it does not now turn out that for some monstrous task conditions they cannot use more than 1 port. I just would understand this scheme if they used port 80, so that users wouldn’t have to even specify a port ... - Mike
- it was just the first link on the site where the proxy_pass directive is mentioned . for illustration only. Of course, the configuration in this case will be different. what is better to ask a separate question. - aleksandr barakin
- I already looked in the direction of nginx, before asking a question here, I shoveled a lot of information and did not find a solution to my problem. As I wrote earlier, only one port is available, not counting the standard ones. If I could use a set of different ports, there would be no problem. On the clients, the port would be forwarded, and the server would simply direct to this unique port and that's it. - Artem
|
имя.поддомена:10030in the browser.имя.поддомена:10030? (well, as you intended) - Mike