|
@@ -7,7 +7,39 @@ and SSL termination for other docker containers.
|
7
|
7
|
More details will be added here in due course. For now, the full process
|
8
|
8
|
is described in [this blog post](https://www.chameth.com/2016/05/21/docker-automatic-nginx-proxy).
|
9
|
9
|
|
10
|
|
-## Adding extra config to Nginx
|
|
10
|
+## Getting started
|
|
11
|
+
|
|
12
|
+The out-of-the-box setup uses [Lexicon](https://github.com/AnalogJ/lexicon)
|
|
13
|
+to perform DNS updates. This will work if you use one DNS provider for all
|
|
14
|
+the domains you wish to use, and Lexicon supports that provider. If that
|
|
15
|
+is the case, then getting started is very easy:
|
|
16
|
+
|
|
17
|
+ 1. Copy docker-compose.override.example.yml to docker-compose.override.yml
|
|
18
|
+ 2. Change the e-mail address, provider, and provider auth details
|
|
19
|
+ 3. Run `docker-compose up -d`
|
|
20
|
+
|
|
21
|
+If you have existing containers with the appropriate labels, the certificates
|
|
22
|
+will be requested for them straight away, and proxy rules added. To launch
|
|
23
|
+a new container and have it be proxied, add the following labels:
|
|
24
|
+
|
|
25
|
+ com.chameth.proxy=<port>
|
|
26
|
+ com.chameth.proxy.protocol=<protocol> # defaults to http
|
|
27
|
+ com.chameth.vhost=<primary vhost>,<secondary vhost>,<...>
|
|
28
|
+
|
|
29
|
+For example:
|
|
30
|
+
|
|
31
|
+ docker run \
|
|
32
|
+ --label com.chameth.proxy=80 \
|
|
33
|
+ --label com.chameth.vhost=example.domain.com \
|
|
34
|
+ tutum/hello-world
|
|
35
|
+
|
|
36
|
+It may take a minute or two for the certificate to be obtained and for
|
|
37
|
+Nginx to be reconfigured. You can see output from the various tools
|
|
38
|
+by running `docker-compose logs -f`.
|
|
39
|
+
|
|
40
|
+## Advanced / Tips and Tricks
|
|
41
|
+
|
|
42
|
+### Adding extra config to Nginx
|
11
|
43
|
|
12
|
44
|
Out of the box, the Nginx server will only handle HTTPS requests,
|
13
|
45
|
with a very minimal config. The [extra](extra/) directory contains
|
|
@@ -17,9 +49,7 @@ useful.
|
17
|
49
|
Once you have the services running, you can copy additional config
|
18
|
50
|
using the cp command:
|
19
|
51
|
|
20
|
|
-```
|
21
|
|
-docker cp file.conf autoproxy_nginx:/etc/nginx/conf.d/
|
22
|
|
-```
|
|
52
|
+ docker cp file.conf autoproxy_nginx:/etc/nginx/conf.d/
|
23
|
53
|
|
24
|
54
|
The following config files are available in the extra directory:
|
25
|
55
|
|
|
@@ -35,7 +65,7 @@ The following config files are available in the extra directory:
|
35
|
65
|
disable old protocols and ciphers, enable stapling, etc. This will prevent
|
36
|
66
|
access from older browsers and operating systems!
|
37
|
67
|
|
38
|
|
-## Hosting static content
|
|
68
|
+### Hosting static content
|
39
|
69
|
|
40
|
70
|
If you're serving static content, it's not desirable to have lots of
|
41
|
71
|
instances of nginx running just to handle requests from the proxy.
|