user root; #nginx;
worker_processes 2; #auto;
#master_process off;
worker_rlimit_core 1000M;
working_directory /tmp/cores;
error_log /var/log/nginx/error.log debug;

# pid /var/log/run/nginx.pid;
events {
    worker_connections 65535;
}
#env GRPC_TRACE=health_check_client,client_channel,error_refcount,call_combiner,combiner,connectivity_state,op_failure,call_error;
#env GRPC_VERBOSITY=DEBUG;
http {
    include /etc/nginx/mime.types;
    #access_log /var/log/nginx/access.log main;
    wafos_enforcer_address 10.1.0.13:50051;
    wafos_configuration_export_addr  10.1.0.14:50051;
    wafos_enforcer_debug /var/log/nginx/grpc.log debug;
   wafos_deployment_id 189;
   wafos_enforcer_config_interval_sec 3;
  # wafos_enforcer_config_interval_sec 0;
   # wafos_enforcer_max_keep_body_size 10000;
   # wafos_enforcer_grpc_action_queue_size 20;
   # wafos_enforcer_tokio_global_queue_interval 61;
   # wafos_enforcer_tokio_event_interval 31;
   # wafos_enforcer_tokio_max_io_events_per_tick 512;
   wafos_security_log "log_default" syslog:server=localhost:514;
 wafos_policy_name wafos_g_policy;
wafos_security_log_enable on;
    access_log off;
    keepalive_timeout 65;
    wafos_failure_mode_action drop;
    wafos_physical_memory_util_thresholds high=100 low=100;
    wafos_cpu_thresholds high=100 low=100;
    upstream local {
        server www.example.com:8081;
        keepalive 128;
    }

 server {
      #  server_name www.mut.com;
       # listen 80;
        listen 9002;
        listen 80;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        wafos_policy_name wafos_defaulti2_policy;

          wafos_security_log_enable on;
          wafos_security_log /etc/g.json stderr;
         wafos_security_log /etc/g.json stderr;
         location /other{
            wafos_enable on;
            #wafos_policy_file "/etc/wafos/conf/NginxDefaultPolicy.json";
            client_max_body_size 0;
            default_type text/html;

            wafos_security_log_enable off;
            wafos_security_log "log_default" /tmp/logfile.log;
            wafos_security_log "log_default" stderr;
           #return 200 "Thank you for requesting ${request_uri}!!\n";
            proxy_pass http://local;
        }



         location /waf {
            wafos_enable on;
           # wafos_policy_file "/etc/app_protect/conf/NginxDefaultPolicy.json";
            wafos_policy_name tomer_protect_default_policy; #app_protect_default_policy;
            client_max_body_size 0;
            default_type text/html;

            wafos_security_log_enable on;
                wafos_security_log "log_default" syslog:server=localhost:514;
                wafos_security_log "log_default" syslog:server=my.domain.com:514;
                wafos_security_log "log_default" stderr;

            #return 200 "Thank you for requesting ${request_uri}!!\n";
            proxy_pass http://local;
        }

    }

   server {
       # server_name www.mut.com;
        listen 80;
        listen 9002;
  #      listen 80;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        wafos_policy_name wafos_defaulti2_policy;

          wafos_security_log_enable on;
          wafos_security_log /etc/g.json stderr;
         wafos_security_log /etc/g.json stderr;
         location /other{
            wafos_enable on;
            #wafos_policy_file "/etc/wafos/conf/NginxDefaultPolicy.json";
            client_max_body_size 0;
            default_type text/html;

            wafos_security_log_enable off;
            wafos_security_log "log_default" /tmp/logfile.log;
            wafos_security_log "log_default" stderr;
           #return 200 "Thank you for requesting ${request_uri}!!\n";
            proxy_pass http://local;
        }



         location /waf {
            wafos_enable on;
           # wafos_policy_file "/etc/app_protect/conf/NginxDefaultPolicy.json";
            wafos_policy_name tomer_protect_default_policy; #app_protect_default_policy;
            client_max_body_size 0;
            default_type text/html;

            wafos_security_log_enable on;
                wafos_security_log "log_default" syslog:server=localhost:514;
                wafos_security_log "log_default" syslog:server=my.domain.com:514;
                wafos_security_log "log_default" stderr;

            #return 200 "Thank you for requesting ${request_uri}!!\n";
            proxy_pass http://local;
        }

    }


}
