Compare commits
No commits in common. "1fd4118cc8cbd5c38e749451b73a6c89277f04a5" and "fe1ef64e67722e8b14f955bfa2db5204acf819d2" have entirely different histories.
1fd4118cc8
...
fe1ef64e67
@ -20,26 +20,28 @@ compress_types:
|
||||
- text/xml
|
||||
|
||||
request_headers:
|
||||
## '$req_connection' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
Connection: '$req_connection'
|
||||
Upgrade: '$http_upgrade'
|
||||
Early-Data: '$ssl_early_data'
|
||||
{% if env.NGX_HTTP_TRANSPARENT_PROXY == '0' %}
|
||||
Host: '$proxy_host'
|
||||
X-Real-IP: '$remote_addr'
|
||||
## '$proxy_add_forwarded' is defined in /angie/autoconf.dist/http-request-headers-forwarded.conf
|
||||
Forwarded: '$proxy_add_forwarded'
|
||||
## do not pass Accept-Encoding to backend
|
||||
Accept-Encoding: ""
|
||||
## '$req_accept' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
Accept: '$req_accept'
|
||||
## '$req_user_agent' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
User-Agent: '$req_user_agent'
|
||||
{% elif env.NGX_HTTP_TRANSPARENT_PROXY == '1' %}
|
||||
Host: '$host'
|
||||
X-Real-IP: ''
|
||||
Forwarded: ''
|
||||
{% endif %}
|
||||
|
||||
request_headers:
|
||||
## do not pass Accept-Encoding to backend
|
||||
Accept-Encoding: ""
|
||||
## '$req_accept' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
Accept: '$req_accept'
|
||||
## '$req_connection' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
Connection: '$req_connection'
|
||||
Upgrade: '$http_upgrade'
|
||||
Early-Data: '$ssl_early_data'
|
||||
## '$req_user_agent' is defined in /angie/autoconf.dist/http-request-headers-basic.conf.j2
|
||||
User-Agent: '$req_user_agent'
|
||||
{% if env.NGX_HTTP_X_FORWARDED == 'pass' %}
|
||||
X-Forwarded-Proto: '$scheme'
|
||||
X-Forwarded-Host: '$host'
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -ef
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.6}"
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.5}"
|
||||
|
||||
set -a
|
||||
BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}"
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -ef
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.6}"
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.5}"
|
||||
|
||||
set -a
|
||||
BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}"
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -ef
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.6}"
|
||||
IMAGE_VERSION="${IMAGE_VERSION:-v0.0.5}"
|
||||
|
||||
set -a
|
||||
BUILDAH_FORMAT="${BUILDAH_FORMAT:-docker}"
|
||||
|
@ -6,4 +6,3 @@
|
||||
- [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)
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
@ -1,9 +1,5 @@
|
||||
# simple static site
|
||||
|
||||
consult [Dockerfile](Dockerfile) or [docker-compose.yml](docker-compose.yml) - both are simple and fine enough.
|
||||
|
||||
---
|
||||
|
||||
configuration:
|
||||
|
||||
```nginx
|
||||
@ -12,4 +8,13 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
simple as that! :)
|
||||
Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
COPY /static/ /etc/angie/static/
|
||||
```
|
||||
|
||||
both are simple and fine enough.
|
||||
|
@ -1,14 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
angie-conv-example-basic:
|
||||
container_name: angie-conv-example-basic
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
environment:
|
||||
NGX_HTTP_NO_PROXY: 1
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- "./site:/angie/site:ro"
|
||||
- "./static:/angie/static:ro"
|
@ -58,7 +58,7 @@ services:
|
||||
|
||||
my-cache:
|
||||
container_name: my-cache
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
restart: always
|
||||
privileged: true
|
||||
stop_grace_period: 15s
|
||||
|
@ -4,7 +4,7 @@ services:
|
||||
|
||||
my-cache:
|
||||
container_name: my-cache
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
restart: always
|
||||
privileged: true
|
||||
stop_grace_period: 15s
|
||||
|
@ -1,14 +0,0 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
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'
|
@ -1,32 +0,0 @@
|
||||
# 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
|
||||
```
|
@ -1,15 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
angie-conv-example-cfg-override:
|
||||
container_name: angie-conv-example-cfg-override
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
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"
|
@ -1,6 +0,0 @@
|
||||
compress_types: []
|
||||
|
||||
---
|
||||
|
||||
compress_types:
|
||||
- text/plain
|
@ -1,3 +0,0 @@
|
||||
server {
|
||||
listen 8080;
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<hmtl>
|
||||
<body>
|
||||
<h1>Hello World</h1>
|
||||
</body>
|
||||
</hmtl>
|
@ -1 +0,0 @@
|
||||
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.
|
@ -1,4 +1,4 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
@ -3,7 +3,7 @@
|
||||
Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
@ -3,7 +3,7 @@
|
||||
Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
@ -1,6 +1,16 @@
|
||||
# SSL with subdomains
|
||||
|
||||
consult [Dockerfile](Dockerfile) or [docker-compose.yml](docker-compose.yml) - both are simple and fine enough.
|
||||
Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
COPY /static/ /etc/angie/static/
|
||||
COPY /tls/ /etc/angie/tls/
|
||||
|
||||
ENV NGX_HTTP_CONFLOAD='ssl'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
angie-conv-example-ssl:
|
||||
container_name: angie-conv-example-ssl
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
environment:
|
||||
NGX_HTTP_NO_PROXY: 1
|
||||
NGX_HTTP_CONFLOAD: 'ssl v2'
|
||||
ports:
|
||||
- "127.0.0.1:8443:8443"
|
||||
volumes:
|
||||
- "./site:/angie/site:ro"
|
||||
- "./static:/angie/static:ro"
|
||||
- "./tls:/angie/tls:ro"
|
@ -1,4 +1,4 @@
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
SHELL [ "/bin/sh", "-ec" ]
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
|
@ -1,9 +1,5 @@
|
||||
# static site with templates
|
||||
|
||||
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 environment variable `NGX_PROCESS_STATIC=1`.
|
||||
|
||||
configuration:
|
||||
@ -14,6 +10,18 @@ server {
|
||||
}
|
||||
```
|
||||
|
||||
Dockerfile:
|
||||
|
||||
```dockerfile
|
||||
FROM docker.io/rockdrilla/angie-conv:v0.0.5
|
||||
|
||||
COPY /site/ /etc/angie/site/
|
||||
COPY /static/ /etc/angie/static/
|
||||
|
||||
## instruct entrypoint to process static/ - unroll *.j2 templates, etc.
|
||||
ENV NGX_PROCESS_STATIC=1
|
||||
```
|
||||
|
||||
Also note that there's no `index.html` but `index.html.j2`:
|
||||
|
||||
```jinja
|
||||
|
@ -1,15 +0,0 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
angie-conv-example-static-template:
|
||||
container_name: angie-conv-example-static-template
|
||||
image: docker.io/rockdrilla/angie-conv:v0.0.6
|
||||
environment:
|
||||
NGX_HTTP_NO_PROXY: 1
|
||||
NGX_PROCESS_STATIC: 1
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- "./site:/angie/site:ro"
|
||||
- "./static:/angie/static:ro"
|
@ -278,19 +278,11 @@ def merge_dict_recurse(d1, d2: dict) -> dict:
|
||||
|
||||
map_common = {k for k in map1 if is_mapping(d2.get(k))}
|
||||
for k in map_common:
|
||||
y = d2.get(k)
|
||||
if not y:
|
||||
x[k] = {}
|
||||
continue
|
||||
x[k] = merge_dict_recurse(x.get(k), y)
|
||||
x[k] = merge_dict_recurse(x.get(k), d2.get(k))
|
||||
|
||||
seq_common = {k for k in seq1 if is_sequence(d2.get(k))}
|
||||
for k in seq_common:
|
||||
y = d2.get(k)
|
||||
if not y:
|
||||
x[k] = []
|
||||
continue
|
||||
x[k] = uniq(list(x.get(k)) + list(y))
|
||||
x[k] = uniq(list(x.get(k)) + list(d2.get(k)))
|
||||
|
||||
unmerged = (map1 - map_common) | (seq1 - seq_common)
|
||||
for k in unmerged:
|
||||
|
Loading…
Reference in New Issue
Block a user