All configuration files should be stored in the /etc/ibatyr-nginx/sites-available directory. Keys and TLS certificates should be stored in the /etc/ibatyr-nginx/ssl directory. It is recommended to create a new configuration file by application name. The file configuration consists of a block\blocks server. Configuration example:
server { include static/server.conf; listen 80; server_name example.com www.example.com; # WAF configuration.
set $BACKEND http://192.168.1.100;
location / { include static/waf.conf; } }
server { include static/server.conf; listen 443 ssl; ssl_certificate ssl/cert.crt; ssl_certificate_key ssl/cert.key; server_name example.com www.example.com; # WAF configuration.
set $BACKEND https://192.168.1.100:443;
location / { include static/waf.conf; } }
The listen directive contains parameters with the port number to which the backend will be proxied. The ssl parameter for this directive indicates that the traffic should be available via HTTPS.
The ssl_certificate* directives in their parameters contain paths to files with SSL certificates and keys. This is necessary in order to terminate TLS encrypted traffic before it reaches iBatyr WAF.
The server_name directive contains domain names (Host header) to which requests will be sent. It’s worth noting that you need to include all domain names of the application, for example, www.example.com, example.com. Otherwise, some requests may be processed incorrectly.
The parameter of the set $BACKEND directive contains the full backend address indicating the protocol and port number.