Write intro for nginx config

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis 2017-10-28 15:35:59 +01:00
parent 5832d1415e
commit c65e2ee375
2 changed files with 19 additions and 3 deletions

1
contrib/nginx/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
openfaas.htpasswd

View File

@ -1,3 +1,18 @@
### Basic auth in 5 seconds
This guide shows you how to protect your cluster with "Basic Auth" which involves setting a username
and password. This method will prevent tampering but for production usage will also need TLS
enabling. Free TLS certificates can be generated with LetsEncrypt.
Steps:
* Generate a password file
* Push file into secret store
* Unexpose the gateway
* Create an Nginx proxy container with the new secret
* Test it out.
### Create a .htaccess: ### Create a .htaccess:
``` ```
@ -39,12 +54,12 @@ q70h0nsj9odbtv12vrsijcutx openfaas_htpasswd 13 seconds a
$ docker service update func_gateway --publish-rm 8080 $ docker service update func_gateway --publish-rm 8080
``` ```
### Build an Nginx container ### Build an Nginx container (optional)
Build gwnginx from contrib directory. Build gwnginx from contrib directory if you need customizations.
``` ```
$ docker build -t gwnginx . $ docker build -t alexellis/gwnginx:0.1 .
``` ```
### Launch nginx ### Launch nginx