1
0

doc: update examples

This commit is contained in:
Konstantin Demin 2024-09-20 22:51:44 +03:00
parent 5b8ef5329e
commit b92bd85597
Signed by: krd
GPG Key ID: 4D56F87A8BA65FD0
3 changed files with 81 additions and 44 deletions

View File

@ -1,5 +1,22 @@
# print env via NJS # print env via NJS
Dockerfile:
```dockerfile
FROM docker.io/rockdrilla/angie-conv:v0.0.1
COPY /site/ /etc/angie/site/
## install 'angie-module-njs' and process package contents
RUN apt-install-angie-mod.sh njs ; \
apt-clean.sh
## load ngx_http_js_module
ENV NGX_HTTP_MODULES='njs'
```
---
configuration: configuration:
```nginx ```nginx
@ -16,6 +33,8 @@ server {
} }
``` ```
---
NJS script: NJS script:
```js ```js
@ -33,20 +52,7 @@ function report(r) {
export default { report }; export default { report };
``` ```
Dockerfile: ---
```dockerfile
FROM docker.io/rockdrilla/angie-conv:v0.0.1
COPY /site/ /etc/angie/site/
## install 'angie-module-njs' and process package contents
RUN apt-install-angie-mod.sh njs ; \
apt-clean.sh
## load ngx_http_js_module
ENV NGX_HTTP_MODULES='njs'
```
Test URI e.g. with `curl`: Test URI e.g. with `curl`:
```sh ```sh

View File

@ -1,5 +1,22 @@
# print env via Perl # print env via Perl
Dockerfile:
```dockerfile
FROM docker.io/rockdrilla/angie-conv:v0.0.1
COPY /site/ /etc/angie/site/
## install 'angie-module-perl' and process package contents
RUN apt-install-angie-mod.sh perl ; \
apt-clean.sh
## load ngx_http_perl_module
ENV NGX_HTTP_MODULES='perl'
```
---
configuration: configuration:
```nginx ```nginx
@ -16,6 +33,8 @@ server {
} }
``` ```
---
Perl script: Perl script:
```perl ```perl
@ -43,20 +62,7 @@ sub report {
__END__ __END__
``` ```
Dockerfile: ---
```dockerfile
FROM docker.io/rockdrilla/angie-conv:v0.0.1
COPY /site/ /etc/angie/site/
## install 'angie-module-perl' and process package contents
RUN apt-install-angie-mod.sh perl ; \
apt-clean.sh
## load ngx_http_perl_module
ENV NGX_HTTP_MODULES='perl'
```
Test URI e.g. with `curl`: Test URI e.g. with `curl`:
```sh ```sh

View File

@ -1,20 +1,5 @@
# SSL with subdomains # SSL with subdomains
configuration:
```nginx
server {
listen 8443 ssl;
server_name example.org;
ssl_certificate tls.d/example.org.chain.crt;
ssl_certificate_key tls.d/example.org.pem;
root static.d/example.org;
}
```
Dockerfile: Dockerfile:
```dockerfile ```dockerfile
@ -27,7 +12,45 @@ COPY /tls/ /etc/angie/tls/
ENV NGX_HTTP_CONFLOAD='ssl' ENV NGX_HTTP_CONFLOAD='ssl'
``` ```
Optional cut-off SSL server block: ---
configuration:
```nginx
server {
listen 8443 ssl;
server_name www.example.org;
ssl_certificate tls.d/www.example.org.chain.crt;
ssl_certificate_key tls.d/www.example.org.pem;
root static.d/www.example.org;
}
```
---
configuration for wildcard certificate:
```nginx
server {
listen 8443 ssl;
server_name .example.org;
ssl_certificate tls.d/example.org.chain.crt;
ssl_certificate_key tls.d/example.org.pem;
root static.d/example.org;
}
```
*Note: certificate must have* `X509v3 Subject Alternative Name` *property with value like* `DNS:example.org, DNS:*.example.org` .
---
(optional) configuration for cut-off SSL server block (see [documentation](https://angie.software/en/configuration/modules/http/http_ssl/#ssl-reject-handshake) for rationale):
```nginx ```nginx
server { server {
@ -42,6 +65,8 @@ server {
} }
``` ```
---
Test URI e.g. with `curl`: Test URI e.g. with `curl`:
```sh ```sh
curl --cacert ./tls/ca/root-ca.crt --capath /nonexistent --resolve example.org:8443:127.0.0.1 https://example.org:8443/ curl --cacert ./tls/ca/root-ca.crt --capath /nonexistent --resolve example.org:8443:127.0.0.1 https://example.org:8443/