Skip to content

Instantly share code, notes, and snippets.

@rpromyshlennikov
Created August 30, 2024 15:22
Show Gist options
  • Save rpromyshlennikov/79aca482c8620b5a235ddf943aae96e9 to your computer and use it in GitHub Desktop.
Save rpromyshlennikov/79aca482c8620b5a235ddf943aae96e9 to your computer and use it in GitHub Desktop.
SSH remote port forwarding to VM in network
# 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
@rpromyshlennikov
Copy link
Author

To not recall it every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment