Created
December 5, 2020 08:26
-
-
Save notflip/7c39fe8e671139679f16e1df5a191bc0 to your computer and use it in GitHub Desktop.
SSH Tunnel with AutoSSH Keep Alive
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
# .ssh/config | |
Host tunnel-notflip | |
Hostname tunnel.notflip.be | |
User root | |
IdentityFile ~/.ssh/id_rsa | |
RemoteForward 20000 localhost:8000 | |
ServerAliveInterval 30 | |
ServerAliveCountMax 3 | |
# .zshrc (or .bashrc) | |
alias tunnel="AUTOSSH_DEBUG=1 autossh -M 0 -T -N tunnel-notflip" | |
# On Server /etc/nginx/sites-available/tunnel.notflip.be | |
server { | |
server_name tunnel.notflip.be; | |
listen 80; | |
location / { | |
proxy_pass http://127.0.0.1:20000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment