Just some snippets to test nginx with njs so it generates a nonce that is added as a http response header.
- Install nginx and njs from nginx repository;
- Add load_module modules/ngx_http_js_module.so; to nginx.conf;
- Create /etc/nginx/njs/getnonce.js with contents like in the example;
- Create /etc/nginx/conf.d/noncetest.conf with contents like in the example;
- (re)start nginx (sudo systemctl restart nginx.service);
- test with curl -I http://localhost:8080