Skip to content

Simple njs-compliant javascript that generates secure nonces

Notifications You must be signed in to change notification settings

i81b4u/njs_cspnonce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Just some snippets to test nginx with njs so it generates a nonce that is added as a http response header.

  1. Install nginx and njs from nginx repository;
  2. Add load_module modules/ngx_http_js_module.so; to nginx.conf;
  3. Create /etc/nginx/njs/getnonce.js with contents like in the example;
  4. Create /etc/nginx/conf.d/noncetest.conf with contents like in the example;
  5. (re)start nginx (sudo systemctl restart nginx.service);
  6. test with curl -I http://localhost:8080

About

Simple njs-compliant javascript that generates secure nonces

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published