{"id":3431,"date":"2023-01-28T10:36:58","date_gmt":"2023-01-28T10:36:58","guid":{"rendered":"https:\/\/www.webhi.com\/how-to\/?p=3431"},"modified":"2023-01-28T10:37:01","modified_gmt":"2023-01-28T10:37:01","slug":"how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian","status":"publish","type":"post","link":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/","title":{"rendered":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &#038; Debian"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng.jpg\" alt=\"Install and configure the ModSecurity in Nginx on Ubuntu &amp; Debian\" class=\"wp-image-3556\" srcset=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng.jpg 1200w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng-300x169.jpg 300w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng-1024x576.jpg 1024w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng-768x432.jpg 768w, https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng-150x84.jpg 150w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>ModSecurity is an open source, web application firewall (WAF) designed to protect web applications from malicious attacks. It is designed to protect web applications from layer 7 (application layer) attacks such as SQL injection, cross-site scripting (XSS), and many other types of attacks. In this tutorial, we will show you how to install the ModSecurity in Nginx on Ubuntu and Debian systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before you begin, you will need the following:<\/p>\n\n\n\n<ul><li>Ubuntu 16.04\/18.04\/20.04 or Debian 9\/10<\/li><li>Nginx 1.10 or higher<\/li><li>Root user or sudo privileges<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Install Nginx<\/h2>\n\n\n\n<p>If you do not have Nginx Web Server installed on your server already, install Nginx using the following command. If you have Nginx installed already, you can ignore this step.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ sudo apt install nginx<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-download-modsecurity-for-nginx\">Step 2: Download and compile ModSecurity<\/h2>\n\n\n\n<p>Install build dependencies using the following command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ apt-get install libtool autoconf build-essential libpcre3-dev zlib1g-dev libssl-dev libxml2-dev libgeoip-dev liblmdb-dev libyajl-dev libcurl4-openssl-dev libpcre++-dev pkgconf libxslt1-dev libgd-dev automake<\/code><\/pre>\n\n\n\n<p>Now you need to download ModSecurity<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ cd \/usr\/local\/src\n$ git clone --depth 100 -b v3\/master --single-branch https:\/\/github.com\/SpiderLabs\/ModSecurity\n$ cd ModSecurity\n$ git submodule init\n$ git submodule update<\/code><\/pre>\n\n\n\n<p>Now compile ModSecurity and install it on your server<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># Generate configure file\n$ sh build.sh\n# Pre compilation step. Checks for dependencies\n.\/configure\n# Compiles the source code\n$ make\n# Installs the Libmodsecurity to **\/usr\/local\/modsecurity\/lib\/libmodsecurity.so**\n$ make install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-compile-and-install\">Step 3: Download and Compile ModSecurity v3 Nginx Connector Source Code<\/h2>\n\n\n\n<p>Run \u201cnginx -V\u201d and notice your Nginx server version. Now you need to download the matching Nginx source code and Nginx Connector Source Code into your server. The use the source code to generate Libmodsecurity module for your Nginx server. Refer following commands and run one by one in order.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ mkdir \/usr\/local\/src\/cpg\n$ cd \/usr\/local\/src\/cpg<\/code><\/pre>\n\n\n\n<p>Make sure to change versoin number match it with your local Nginx server version<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ wget http:\/\/nginx.org\/download\/nginx-1.21.4.tar.gz\n$ tar -xvzf nginx-1.21.4.tar.gz\n# Download the source code for ModSecurity-nginx connector\n$ git clone https:\/\/github.com\/SpiderLabs\/ModSecurity-nginx<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Compile Nginx<\/h5>\n\n\n\n<p>Next we need to compile Nginx with ModSecurity module. We will not compile\/install Nginx itself but compile the Nginx module only. For this, make sure that your Nginx package is compiled with \u201c\u2013with-compat\u201d flag. The \u2013with-compat flag will make the module binary-compatible with your existing Nginx binary. You can use the following command to compile Nginx + ModSecurity compatible with your existing modules<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ cd nginx-1.21.4\n$ .\/configure --with-compat --with-openssl=\/usr\/include\/openssl\/ --add-dynamic-module=\/usr\/local\/src\/cpg\/ModSecurity-nginx<\/code><\/pre>\n\n\n\n<p>Now we need to build the modules and copy it to the Nginx module directory<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">$ make modules\n\n$ cp objs\/ngx_http_modsecurity_module.so \/usr\/share\/nginx\/modules\/<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-4-configure-modsecurity\">Step 4: Load ModSecurity Module into Nginx<\/h2>\n\n\n\n<p>Open file <code>\/etc\/nginx\/modules-enabled\/50-mod-http-modsecurity.conf<\/code> and add the following contents to it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">load_module modules\/ngx_http_modsecurity_module.so;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Install Nginx configuration<\/h2>\n\n\n\n<p>1. Open <code>\/etc\/nginx\/nginx.conf<\/code> and add the following line after including \u201c<code>\/etc\/nginx\/sites-enabled\/*.conf<\/code>\u201d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">include \/etc\/nginx\/cpguard_waf_load.conf;<\/code><\/pre>\n\n\n\n<p>2. Add the following contents to \/etc\/nginx\/cpguard_waf_load.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">modsecurity on;\nmodsecurity_rules_file \/etc\/nginx\/nginx-modsecurity.conf;<\/code><\/pre>\n\n\n\n<p>3. Add following contents to \/etc\/nginx\/nginx-modsecurity.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">SecRuleEngine On\nSecRequestBodyAccess On\nSecDefaultAction \"phase:2,deny,log,status:406\"\nSecRequestBodyLimitAction ProcessPartial\nSecResponseBodyLimitAction ProcessPartial\nSecRequestBodyLimit 13107200\nSecRequestBodyNoFilesLimit 131072\n\nSecPcreMatchLimit 250000\nSecPcreMatchLimitRecursion 250000\n\nSecCollectionTimeout 600\n\nSecDebugLog \/var\/log\/nginx\/modsec_debug.log\nSecDebugLogLevel 0\nSecAuditEngine RelevantOnly\nSecAuditLog \/var\/log\/nginx\/modsec_audit.log\nSecUploadDir \/tmp\nSecTmpDir \/tmp\nSecDataDir \/tmp\nSecTmpSaveUploadedFiles on\n\n# Include file for cPGuard WAF\nInclude \/etc\/nginx\/cpguard_waf.conf<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-6-configure-cpguard-waf-parameters\">Step 6: Configure cPGuard WAF Parameters<\/h2>\n\n\n\n<p>Once the above steps are completed successfully, you can use the following parameter values.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">waf_server = nginx\n\nwaf_server_conf = \/etc\/nginx\/cpguard_waf.conf\n\nwaf_server_restart_cmd = \/usr\/sbin\/service nginx restart\n\nwaf_audit_log = \/var\/log\/nginx\/modsec_audit.log<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"thats-it\">That\u2019s it<\/h5>\n\n\n\n<p>You should have ModSecurity enabled fine and once the cPGuard WAF is enabled, your server is protected against Web Attacks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ModSecurity is an open source, web application firewall (WAF) designed to protect web applications from malicious attacks. It is designed to protect web applications from layer 7 (application layer) attacks such as SQL injection, cross-site scripting (XSS), and many other types of attacks. In this tutorial, we will show you how to install the ModSecurity ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[],"yoast_head":"\n<title>How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &amp; Debian - WebHi Tutorials &amp; Documentations<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &amp; Debian - WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\" \/>\n<meta property=\"og:site_name\" content=\"WebHi Tutorials &amp; Documentations\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhi.technology\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-28T10:36:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-28T10:37:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng.jpg\" \/>\n<meta name=\"author\" content=\"webhi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:site\" content=\"@WebHiTechnology\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"webhi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\"},\"author\":{\"name\":\"webhi\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\"},\"headline\":\"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &#038; Debian\",\"datePublished\":\"2023-01-28T10:36:58+00:00\",\"dateModified\":\"2023-01-28T10:37:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\"},\"wordCount\":392,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"articleSection\":[\"Security\",\"Web servers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\",\"name\":\"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 & Debian - WebHi Tutorials &amp; Documentations\",\"isPartOf\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\"},\"datePublished\":\"2023-01-28T10:36:58+00:00\",\"dateModified\":\"2023-01-28T10:37:01+00:00\",\"description\":\"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webhi.com\/how-to\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &#038; Debian\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#website\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"name\":\"WebHi Tutorials &amp; Documentations\",\"description\":\"System administration and knowledge base\",\"publisher\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#organization\",\"name\":\"WebHi Technology\",\"url\":\"https:\/\/www.webhi.com\/how-to\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png\",\"width\":288,\"height\":95,\"caption\":\"WebHi Technology\"},\"image\":{\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webhi.technology\",\"https:\/\/twitter.com\/WebHiTechnology\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54\",\"name\":\"webhi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"contentUrl\":\"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743\",\"caption\":\"webhi\"},\"sameAs\":[\"https:\/\/www.webhi.com\/how-to\"],\"url\":\"https:\/\/www.webhi.com\/how-to\/author\/webhi\/\"}]}<\/script>\n","yoast_head_json":{"title":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 & Debian - WebHi Tutorials &amp; Documentations","description":"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/","og_locale":"en_US","og_type":"article","og_title":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 & Debian - WebHi Tutorials &amp; Documentations","og_description":"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.","og_url":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/","og_site_name":"WebHi Tutorials &amp; Documentations","article_publisher":"https:\/\/www.facebook.com\/webhi.technology","article_published_time":"2023-01-28T10:36:58+00:00","article_modified_time":"2023-01-28T10:37:01+00:00","og_image":[{"url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2023\/01\/nginx_modsecurity_eng.jpg"}],"author":"webhi","twitter_card":"summary_large_image","twitter_creator":"@WebHiTechnology","twitter_site":"@WebHiTechnology","twitter_misc":{"Written by":"webhi","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#article","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/"},"author":{"name":"webhi","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54"},"headline":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &#038; Debian","datePublished":"2023-01-28T10:36:58+00:00","dateModified":"2023-01-28T10:37:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/"},"wordCount":392,"commentCount":3,"publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"articleSection":["Security","Web servers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/","url":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/","name":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 & Debian - WebHi Tutorials &amp; Documentations","isPartOf":{"@id":"https:\/\/www.webhi.com\/how-to\/#website"},"datePublished":"2023-01-28T10:36:58+00:00","dateModified":"2023-01-28T10:37:01+00:00","description":"In this tutorial, we will show you how to install and configure the ModSecurity in Nginx on Ubuntu and Debian systems.","breadcrumb":{"@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhi.com\/how-to\/how-to-install-modsecurity-in-nginx-on-ubuntu-18-04-20-4-22-04-debian\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhi.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"How to Install ModSecurity in Nginx on Ubuntu 18.04 20.4 22.04 &#038; Debian"}]},{"@type":"WebSite","@id":"https:\/\/www.webhi.com\/how-to\/#website","url":"https:\/\/www.webhi.com\/how-to\/","name":"WebHi Tutorials &amp; Documentations","description":"System administration and knowledge base","publisher":{"@id":"https:\/\/www.webhi.com\/how-to\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhi.com\/how-to\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webhi.com\/how-to\/#organization","name":"WebHi Technology","url":"https:\/\/www.webhi.com\/how-to\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","contentUrl":"https:\/\/www.webhi.com\/how-to\/gilrogre\/2022\/07\/logo.png","width":288,"height":95,"caption":"WebHi Technology"},"image":{"@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhi.technology","https:\/\/twitter.com\/WebHiTechnology"]},{"@type":"Person","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/b31e76e2311cdc0bb90f5e2733059a54","name":"webhi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webhi.com\/how-to\/#\/schema\/person\/image\/","url":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","contentUrl":"https:\/\/www.webhi.com\/how-to\/ahuphiph\/litespeed\/avatar\/e20da107d0f4c765ead2eef88ad019d8.jpg?ver=1781214743","caption":"webhi"},"sameAs":["https:\/\/www.webhi.com\/how-to"],"url":"https:\/\/www.webhi.com\/how-to\/author\/webhi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3431"}],"collection":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/comments?post=3431"}],"version-history":[{"count":17,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3431\/revisions"}],"predecessor-version":[{"id":3574,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/posts\/3431\/revisions\/3574"}],"wp:attachment":[{"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/media?parent=3431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/categories?post=3431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhi.com\/how-to\/wp-json\/wp\/v2\/tags?post=3431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}