user www-data;
worker_cpu_affinity auto;
worker_processes  auto;
error_log stderr error;
#worker_rlimit_nofile 1024000;
timer_resolution 1s;
daemon off;
pcre_jit on;

events {
    worker_connections 100000;
	multi_accept off;	 
}

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

    sendfile off;
    tcp_nopush off;
    tcp_nodelay on;
    keepalive_timeout 65s;
    keepalive_disable none;
    keepalive_requests 100000;

    php_ini_path /deploy/conf/php.ini;

    server {
        listen       *:8080 backlog=65535 reuseport;

        root /;
        index  index.html;

        php_keepalive 256;

        location = /plaintext {
            content_by_php '
                ngx_header_set("Content-Type", "text/plain");
                echo "Hello, World!";
            ';
        }

        location = /json {
            content_by_php '
                ngx_header_set("Content-Type", "application/json");
                echo json_encode(["message" => "Hello, World!"]);
            ';
        }
    }
}
