# SPDX-FileCopyrightText: 2022-2023 wargio <deroad@libero.it>
# SPDX-License-Identifier: LGPL-3.0-only

master_process off;
daemon off;

load_module $TEST_NGINX_NAXSI_MODULE_SO;
events {
  worker_connections  1024;
  use select;
}
http {
  include            mime.types;
  default_type       application/octet-stream;
  sendfile           on;
  keepalive_timeout  65;
  server {
    listen              4242 ssl http2;
    ssl_certificate     nginx.crt;
    ssl_certificate_key nginx.key;
    server_name         localhost;
    set $naxsi_extensive_log 1;
    location / {
      LearningMode;
      SecRulesEnabled;
      DeniedUrl "/50x.html";
      CheckRule "$SQL >= 8"       BLOCK;
      CheckRule "$RFI >= 8"       BLOCK;
      CheckRule "$TRAVERSAL >= 4" BLOCK;
      CheckRule "$EVADE >= 4"     BLOCK;
      CheckRule "$XSS >= 8"       BLOCK;
      return 200;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
      return 500;
    }
  }
}
