Skip to content

Instantly share code, notes, and snippets.

@sunny0425
Forked from fnando/dev.conf
Last active December 26, 2016 08:07
Show Gist options
  • Save sunny0425/3e7a5130fc59b652abe41d9cc4ca2106 to your computer and use it in GitHub Desktop.
Save sunny0425/3e7a5130fc59b652abe41d9cc4ca2106 to your computer and use it in GitHub Desktop.
Nginx configuration for SSH tunnel
# 在服务器的nginx上添加配置
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.example.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://tunnel;
}
}
// 本地启动
ssh -vnNT -R 3000:localhost:3000 deploy@codeplane.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment