Help

IIS Module: web.config

Controls the firewall from the web.config file

Plesk Windows Server IIS web.config

The Flex Firewall IIS module can be managed directly through your site's web.config file, offering fine-grained, per-application control.

Locate the web.config file in the domain's main folder


The web.config file controls various IIS settings. If you don't have this file, you can create it manually.

Add the configuration code


Open the web.config file with a text editor (Notepad or similar) and add the following lines:

<system.webServer>\n<FlexFirewall enable="true" denycountry="CN" denyia="true" />\n</system.webServer>

Important: If the file already exists, make sure you don't duplicate lines.

Parameter Type Required Value Description
enable Text Optional true,false,0,1,on, off Enable or disable the module
denycountry Text Optional CN,BR, etc ... List of country codes/abbreviations to be blocked; if there are several countries, use a comma separator.
denyia Text Optional true,false,0,1,on, off Block or allow connections made from AI such as ChatGPT or DeepSeek