Skip to content

Instantly share code, notes, and snippets.

@joost
Last active September 19, 2018 02:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joost/5713404 to your computer and use it in GitHub Desktop.
Save joost/5713404 to your computer and use it in GitHub Desktop.
How to share a local site over the web using Pow.cx and Nginx. Similar to forwardhq.com, showoff.io, .. but your own and free.
  • Have pow.cx (http://pow.cx) installed

  • Create a DNS record *.dev.yourserver.com pointing to your Nginx server

  • Configure Nginx with the configuration below

  • Run: ssh -p 22 -nNT -g -R *:8888:0.0.0.0:3000 account@youserver.com

  • Go to http://somepowdomain.dev.yourserver.com and enjoy!

      server {
          listen 80;
          server_name *.dev.yourserver.com;
      
          location / {
            if ($host ~* "(.*)\.dev\.yourserver\.com" ) {
              set  $tunnel_app  $1.dev;
            }
      
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header  X-Forwarded-Host $host;
            proxy_set_header  Host $tunnel_app;
            proxy_redirect    off;
            proxy_pass        http://localhost:8888;
          }
      }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment