Score:0

make ssh tunnel to remote server and manage with containerised NginX instance

cv flag
itd

here is what I am trying to do:

I have a small Hetzner cloud server where I run multiple docker containers. One of them is an NginX container, that accepts connections and forwards it to other docker applications. Now I wanted to make an ssh tunnel to the server so I could access a local application via the Hetzner IP. This does not seem to work. I created the remote ssh tunnel like this: ssh -R 80:127.0.0.1:8080 -N -f root@[remote-ip] This worked. When logging in via ssh and calling curl on that port I get the expected output. However, the local application is not accessible via the Hetzner IP: [IP]:8080. It says that the connection was refused.

Well ok. Maybe port 8080 is disabled. So I wanted to forward one of the domains in Nginx to that port. Here it gets interesting. I wanted to map the port 8080 in docker-compose.yml and access the application via 172.17. 0.1, just to test if that's possible. As soon as I did that the ssh tunnel got messed up. Is that something that can happen?

Unfortunately, I do not have a lot of experience with servers, I just wanted to access a local application via a public URL (I have a dynamic IP so I thought an ssh tunnel would be the quickest option), maybe I am completely wrong and it is not possible to achieve my goal like this.

Is it possible to access an ssh tunnel on the host from a container and if so, how?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.