doc: add j2cfg-override example
This commit is contained in:
parent
e190393397
commit
086b6c4ccd
@ -6,3 +6,4 @@
|
||||
- [print env via Perl](perl/README.md)
|
||||
- [SSL with subdomains](ssl/README.md)
|
||||
- [generating config with templates](config-template/README.md)
|
||||
- [container configuration override](j2cfg-override/README.md)
|
||||
|
14
doc/examples/j2cfg-override/Dockerfile
Normal file
14
doc/examples/j2cfg-override/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /j2cfg/ /etc/angie/j2cfg/
|
||||
COPY /site/ /etc/angie/site/
|
||||
COPY /static/ /etc/angie/static/
|
||||
|
||||
ENV NGX_HTTP_CONFLOAD='gzip'
|
||||
|
||||
## same as above (adjusted to above variant by entrypoint):
|
||||
## ENV NGX_HTTP_MODULES='gzip'
|
||||
|
||||
## enable support for brotli and zstd:
|
||||
## ENV NGX_HTTP_MODULES='gzip brotli zstd'
|
32
doc/examples/j2cfg-override/README.md
Normal file
32
doc/examples/j2cfg-override/README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# container configuration override
|
||||
|
||||
consult [Dockerfile](Dockerfile) or [docker-compose.yml](docker-compose.yml) - both are simple and fine enough.
|
||||
|
||||
---
|
||||
|
||||
mostly same as [simple static site](../basic/README.md) except container configuration file `j2cfg/override-compress-types.yml`.
|
||||
|
||||
`j2cfg/override-compress-types.yml`:
|
||||
```yml
|
||||
compress_types: []
|
||||
|
||||
---
|
||||
|
||||
compress_types:
|
||||
- text/plain
|
||||
```
|
||||
|
||||
this effectively disables response compression for all mime types except `text/plain`.
|
||||
|
||||
---
|
||||
|
||||
in order to enable (!) response compression specify environment variable `NGX_HTTP_CONFLOAD='gzip'` or `NGX_HTTP_MODULES='gzip brotli zstd'` (for gzip, brotli and zstd).
|
||||
|
||||
---
|
||||
|
||||
Test URI e.g. with `curl`:
|
||||
```sh
|
||||
curl -v --compressed http://127.0.0.1:8080/index.html
|
||||
|
||||
curl -v --compressed http://127.0.0.1:8080/index.txt
|
||||
```
|
15
doc/examples/j2cfg-override/docker-compose.yml
Normal file
15
doc/examples/j2cfg-override/docker-compose.yml
Normal file
@ -0,0 +1,15 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
angie-conv-example-cfg-override:
|
||||
container_name: angie-conv-example-cfg-override
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
environment:
|
||||
NGX_HTTP_MODULES: 'gzip brotli zstd'
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- "./j2cfg:/angie/j2cfg:ro"
|
||||
- "./site:/angie/site:ro"
|
||||
- "./static:/angie/static:ro"
|
@ -0,0 +1,6 @@
|
||||
compress_types: []
|
||||
|
||||
---
|
||||
|
||||
compress_types:
|
||||
- text/plain
|
3
doc/examples/j2cfg-override/site/http-site.conf
Normal file
3
doc/examples/j2cfg-override/site/http-site.conf
Normal file
@ -0,0 +1,3 @@
|
||||
server {
|
||||
listen 8080;
|
||||
}
|
5
doc/examples/j2cfg-override/static/index.html
Normal file
5
doc/examples/j2cfg-override/static/index.html
Normal file
@ -0,0 +1,5 @@
|
||||
<hmtl>
|
||||
<body>
|
||||
<h1>Hello World</h1>
|
||||
</body>
|
||||
</hmtl>
|
1
doc/examples/j2cfg-override/static/index.txt
Normal file
1
doc/examples/j2cfg-override/static/index.txt
Normal file
@ -0,0 +1 @@
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
Loading…
Reference in New Issue
Block a user