Created
August 30, 2024 15:22
-
-
Save rpromyshlennikov/79aca482c8620b5a235ddf943aae96e9 to your computer and use it in GitHub Desktop.
SSH remote port forwarding to VM in network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Purpose: | |
# You have remoteserver.example.com with up & running Nginx, there is a TLS cert on it. You need to serve something in your localnetwork securely to Internet. | |
# Terminating HTTPs on remoteserver.example.com: remoteserver.example.com:443/ --proxy_pass--> http://localhost:18089/ | |
# Target host (192.168.0.226) is in your local network (also it could be VM on your machine) behind NAT on your router (it's your gateway for network 192.168.0.0/24) | |
# Target server runs on target host on port 8089 (192.168.0.226:8089) | |
# | |
# That's all. | |
ssh -NR localhost:18089:192.168.0.226:8089 remoteserver.example.com | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To not recall it every time.