@@ -11,22 +11,50 @@ Pair nginx-proxy with your favorite upstream server (wsgi, uwsgi, asgi, et al.)
1111| ` PROXY_REVERSE_URL ` | Upstream server URL | Yes | | http://myapp:8080 |
1212| ` LISTEN_PORT ` | Server port | Yes | 8080 | |
1313| ` SILENT ` | Silence entrypoint output | No | | |
14+ | ` STATIC_LOCATIONS ` | Static asset mappings | No | | |
15+
16+ ### Hosting Static Assets
17+
18+ Static files can be hosted from your proxied application by sharing a volume
19+ mount between nginx-proxy and your app container then defining a list of
20+ hosted directories using ` STATIC_LOCATIONS ` .
21+
22+ In ECS, you can mount directies with with the ` volumesFrom ` directive. With
23+ docker-compose like so:
24+
25+ ``` yaml
26+ services :
27+ app :
28+ # ...
29+ volumes :
30+ static:/var/www/static
31+ proxy :
32+ # ...
33+ environment :
34+ STATIC_LOCATIONS:/static/:/var/www/static/
35+ volumes :
36+ static:/var/www/static
37+ volumes :
38+ static :
39+ ` ` `
40+
41+ The syntax of ` STATIC_LOCATIONS` is `HOSTED_PATH1:LOCAL_PATH1,HOSTED_PATH2:LOCAL_PATH2`
1442
1543# # Development
1644
1745A test suite is baked into nginx-proxy's Dockerfile. You can run it by building
1846the test layer : ` docker build --target test .`
1947
20- [ nginx container ] : https://hub.docker.com/_/nginx
21- [ mo ] : https://github.com/tests-always-included/mo
22-
2348# ## Differences from standard nginx container
2449
2550Notable differences from the official [nginx container][]
2651
27- - [ mo ] [ ] is used to render nginx configuration templates so that image startup
52+ - [gomplate ][] is used to render nginx configuration templates so that image startup
2853 is aborted if a template variable is missing. This is an improvement over the
2954 official image, which uses `envsubst`.
3055- alpine's official nginx package is used in order to ensure compatibility with
3156 distro-provided nginx modules. This is another enhancement, as the official
3257 image cannot be used with alpine's nginx modules.
58+
59+ [nginx container] : https://hub.docker.com/_/nginx
60+ [gomplate] : https://docs.gomplate.ca/
0 commit comments