ssh-tunnel-over-nginx

Example:

# Install nginx with ssh-tunnel backend.
- ssh-tunnel-over-nginx:
    hostname: dev.frkl.io
    ssh_port: 3333
    server_admin: my@email.com

Description

Set up a self-hosted service similar to ngrok.

A Nginx web server (with valid Letsencrypt https certificate) proxies content from your local machine, after you established an ssh-tunnel. You can use your own domain name(s), all you need is a virtual server somewhere on the internet.

To connect to the service, use:

ssh -N -T -R <ssh_port>:localhost:<your_local_application_port> [server_user@]<server_domain>

Then, you (or anyone else) can connect with a browser on 'https://server_domain'.

Resources

Variables

Name Type Default Description

server_admin

string --

The server admin email (used for the Letsencrypt cert request). Required

hostname

string localhost

The domain name the webserver should listen on.

ssh_port

integer 3333

The port nginx should connect to (on the server).

Examples

Example 1

Install nginx with ssh-tunnel backend.

Code
- ssh-tunnel-over-nginx:
    hostname: dev.frkl.io
    ssh_port: 3333
    server_admin: my@email.com
Description

Install and configure Nginx to serve a proxied service running on a local laptop or similar.

To connect the proxied service, the developer would issue (assuming the service runs on port 5000 locally):

ssh -N -T -R 3333:localhost:5000 username@dev.frkl.io

To access, a user could then visit 'https://dev.frkl.io' in a browser.

Command-line

frecklecute --community ssh-tunnel-over-nginx --help

Usage: frecklecute ssh-tunnel-over-nginx [OPTIONS]

  Set up a self-hosted service similar to ngrok.

  A Nginx web server (with valid Letsencrypt https certificate) proxies
  content from your local machine, after you established an ssh-tunnel. You
  can use your own domain name(s), all you need is a virtual server
  somewhere on the internet.

  To connect to the service, use:

      ssh -N -T -R <ssh_port>:localhost:<your_local_application_port>
      [server_user@]<server_domain>

  Then, you (or anyone else) can connect with a browser on
  'https://server_domain'.

Options:
  --server-admin EMAIL  The server admin email (used for the Letsencrypt cert
                        request).  [required]
  --hostname HOSTNAME   The domain name the webserver should listen on.
  --ssh-port SSH_PORT   The port nginx should connect to (on the server).
  --help                Show this message and exit.