worker_processes auto;
worker_cpu_affinity auto;
error_log stderr error;
#worker_rlimit_nofile 1024000;
timer_resolution 1s;
daemon off;

load_module modules/ngx_http_js_module.so;

events {
   worker_connections 32768;
   multi_accept off; #default
}

http {
   include /etc/nginx/mime.types;
   access_log off;
   server_tokens off;
   msie_padding off;

   sendfile off; #default
   tcp_nopush off; #default
   tcp_nodelay on; #default
   keepalive_timeout 65;
   keepalive_disable none; #default msie6
   keepalive_requests 300000; #default 100

   js_path "/etc/nginx/njs/";

   #js_import utils.js;
   js_import main from /njs/hello.js;

   server {
      listen 8080 default_server reuseport deferred fastopen=4096;
      #8080 default_server reuseport deferred backlog=65535 fastopen=4096;

      location = /plaintext {
         js_content main.hello;
      }

      location = /json {
         js_content main.json;
      }

      #location = /version {
      #   js_content utils.version;
      #}
   }
}
