From 0fb9d2d13c9c3d231580a09e31bb915767a93752 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Wed, 14 Feb 2018 17:37:34 +0000 Subject: [PATCH 1/2] Update 'README.md' --- README.md | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ae1b982..c440d32 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,23 @@ # proxy -## Install openresty +## API docs +[API dpcs](api.md) -## Install redis +## Server set up -## install lua plugin +* Install openresty + +* Install redis + +* install lua plugin ```bash apt install luarocks sudo luarocks install lua-resty-auto-ssl ``` +* openresty config - -## openresty config - - +Set up fail back SSL certs ```bash mkdir /etc/ssl/ @@ -25,7 +28,7 @@ openssl req -new -newkey rsa:2048 -days 3650 -nodes -x509 -subj '/CN=sni-suppo ``` -/etc/openresty/nginx.conf +change the `/etc/openresty/nginx.conf to have this config` ``` #user nobody; @@ -107,7 +110,7 @@ http { ``` -/etc/openresty/autossl.conf +add the SSL config file `/etc/openresty/autossl.conf` ``` ssl_protocols TLSv1 TLSv1.1 TLSv1.2; @@ -130,7 +133,7 @@ http { ``` -/etc/openresty/sites-enabled/000-proxy +Add the proxy config `/etc/openresty/sites-enabled/000-proxy` ``` @@ -162,7 +165,7 @@ server { return ngx.exit(500) end - local host, err = red:hget(key, "ip") + local host, err = red:hget("proxy_host_"..key, "ip") if not host then ngx.log(ngx.ERR, "failed to get redis key: ", err) return ngx.exit(500) @@ -188,6 +191,8 @@ server { } ``` + + ## ref https://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html From 7d4ceb11930c30f274e849c2257c3543f61c8c78 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Wed, 14 Feb 2018 18:00:53 +0000 Subject: [PATCH 2/2] Update 'README.md' --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index c440d32..072d54a 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,29 @@ ## Server set up +The server requires: +* NodeJS 8.x +* open ssh server(any modern version will do) +* inbound Internet access +* redis +* lua rocks + +This has been tested on ubuntu 16.04, but should work on any modern Linux distro. It used the Linux users for its user management, so this will **ONLY** work on Linux, no macOS, BSD or Windows. + +The steps below are for a new ubuntu server, they should be mostly the same for other distros, but the paths and availability of packages may vary. + +* Install open ssh server + ```bash + apt install ssh + ``` + * Install openresty + [OpenResty® Linux Packages](https://openresty.org/en/linux-packages.html) * Install redis + ```bash + apt install redis-server + ``` * install lua plugin ```bash