https://nginx.org/en/docs/njs/ https://github.com/nginx/njs-examples#authorizing-requests-using-auth-request-http-authorization-auth-request # /etc/nginx/site-enable/custom-host.conf http { js_path "/etc/nginx/njs/"; js_import main from authorize.js; upstream backend1 { server 127.0.0.1:8081; } upstream backend2 { server 127.0.0.1:8082; } server { listen 80; location / { js_content main.authoriz..