|
@@ -0,0 +1,36 @@
|
|
1
|
+# Automatic reverse proxying with Docker and nginx
|
|
2
|
+
|
|
3
|
+This repository contains the `docker-compose.yml` file used to bring up
|
|
4
|
+a collection of containers that will provide automatic reverse proxying
|
|
5
|
+and SSL termination for other docker containers.
|
|
6
|
+
|
|
7
|
+More details will be added here in due course. For now, the full process
|
|
8
|
+is described in [this blog post](https://www.chameth.com/2016/05/21/docker-automatic-nginx-proxy.html).
|
|
9
|
+
|
|
10
|
+## Hosting static content
|
|
11
|
+
|
|
12
|
+If you're serving static content, it's not desirable to have lots of
|
|
13
|
+instances of nginx running just to handle requests from the proxy.
|
|
14
|
+
|
|
15
|
+I recommend using [GoStatic](https://github.com/PierreZ/goStatic) to
|
|
16
|
+host static content. This is a very small image that runs a very
|
|
17
|
+small Go binary to serve the files. You can use it in a docker-compose
|
|
18
|
+file like so:
|
|
19
|
+
|
|
20
|
+```yaml
|
|
21
|
+---
|
|
22
|
+
|
|
23
|
+version: '2'
|
|
24
|
+
|
|
25
|
+services:
|
|
26
|
+ www:
|
|
27
|
+ image: pierrezemb/gostatic:latest
|
|
28
|
+ command:
|
|
29
|
+ - --forceHTTP
|
|
30
|
+ labels:
|
|
31
|
+ com.chameth.vhost: 'example.com'
|
|
32
|
+ com.chameth.proxy: '8043'
|
|
33
|
+ volumes:
|
|
34
|
+ - ./www:/srv/http
|
|
35
|
+```
|
|
36
|
+
|