1
0

initial commit

This commit is contained in:
2025-06-05 11:01:19 +03:00
commit 48f13f97a3
297 changed files with 7136 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
# print env via NJS
consult [Dockerfile](Dockerfile) or [docker-compose.yml](docker-compose.yml) - both are simple and fine enough.
---
configuration:
```nginx
server {
listen 8080;
location / { return 204; }
js_import ngx_env.js;
location = /env
{
js_content ngx_env.report;
}
}
```
---
NJS script:
```js
function report(r) {
var s = "";
const keys = Object.keys(process.env).sort();
for (const i in keys) {
const k = keys[i];
const v = process.env[k];
s += k + '=' + v + "\n";
}
r.return(200, s);
}
export default { report };
```
---
Test URI e.g. with `curl`:
```sh
curl http://127.0.0.1:8080/env
```