NEL

The NEL header is used to configure Network Error Logging.

NEL is an experimental HTTP response header used by websites to setup error logging for networking errors. Once it is configured, the website will receive reports about network connections. The content of the NEL header is a JSON object with several options defined as key/value pairs.

Options
  • report_to: References a Report To header which specifies where to send the reports.
  • max_age: The lifetime (in seconds) of this policy.
  • include_subdomains: A boolean (true/false) that indicates if subdomains of the domain should also send reports.
  • success_fraction: The percentage of successful network requests to report, expressed as a decimal between 0 and 1. Set to 0 for no reporting. Set this to 1 only if you want to log every single successful request to your server. There are probably better ways to log successful requests.
  • failure_fraction: The percentage of failed network requests to report, expressed as a decimal between 0 and 1. Set to 0 for no reporting.

Example

In this example, half of the failed network connections and none of the successful network connections will be sent to the "myServer" group specified in the Report To HTTP header. This policy will remain cached for 30 days.

NEL: { "report_to": "myServer", "max_age": 2592000, "failure_fraction": 0.5 }

For more information, please read the documentation on MDN Web Docs.

Ready to validate your website to check for this header and 100+ others important tests?