Reverse tunnel

News Site news RSS

Latest articles New articles RSS

Latest news from Twitter Follow Secretkeeper4 and www.svesoftware.com on Twitter

Reverse tunnel

If you need public access to your intranet test environment and you have no other options but to avoid security rules, one may use SSH as reverse tunnel.
All you need is SSH and publicly accessible host, hosted on webfaction for instance, as this one is.
From your intranet host, behind firewall, router, etc.. who knows what, execute following command:

ssh -R 20001:localhost:80 user@svesoftware.com

upon prompt, enter password of your remote host SSH account. Now, your intranet machine's port 80 will be accessible from your host on port 20001.

All you need is a little nginx setup (nginx.conf):

location /intranet/ {
                proxy_pass http://localhost:20001;
                proxy_set_header X-Real-IP $remote_addr;
}
 
And your intranet web server is ready for testing - of google analytics, for instance.
Upon testing, deactivate tunnel to prevent any unauthorized mangling on intranet web server.