Skip to content

nemesida-waf/custom_pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Custom Nemesida WAF blocking page

Display a beautiful page when blocking a Nemesida WAF request with additional information instead of a normal 403 page. To activate the page, follow these steps:

Nemesida WAF Custom 403 Page

  1. Create a file with custom page settings (e.g. /etc/nginx/snippets/custom_pages.conf):
## Error pages
error_page 403 =222 /403.html;

## Locations
location /403.html {

        internal;
        root /var/www/custom_pages/;
        proxy_no_cache 1;
        proxy_cache_bypass 1;

        add_header host $host always;
        add_header x-request-id $request_id always;
        add_header x-remote-ip $remote_addr always;
        add_header nemesidawaf-bt $nwaf_block_type always;
        add_header nemesidawaf-cc $nwaf_cc always;

}
  1. Create a direcory for storing cusom page (e.g. /var/www/custom_pages/) and save 403.html there. Set permissions to access for NGINX's user (e.g. chown -R nginx:nginx /var/www/custom_pages).

  2. Include a file to NGINX for virtual host (e.g. /etc/nging/conf.d/example.com.conf):

server {

    ...
    listen ...;
    server_name ...;
    ...

    include snippets/custom_pages.conf;

    ...
    location / {
        ...
    }
    ...

}
  1. Check NGINX's status and reload it
# nginx -t && service nginx reload
  1. After that, check that everything works correctly by sending a request with a Nemesida WAF's test signature using a browser:
http://example.com/nwaftest

In which case, check the NGINX error logs (e.g. /var/www/nginx/error.log).

About

The custom page of the Nemesida WAF blocking

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages