ancient_browser_value

Sets the value for treating requests from very old browsers.

Syntaxancient_browser_value value;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The ancient_browser_value directive in NGINX is used to specify a response setting for requests originating from outdated web browsers identified as 'ancient'. Essentially, this directive indicates how NGINX should handle these requests, allowing it to optimize responses or apply specific rules to enhance user experience or maintain compatibility. The directive can be placed in various contexts such as http, server, or location, providing flexibility in application depending on the scope of the configuration.

The directive accepts a single argument, which is typically a numerical value or a string that denotes the action to be taken or the value to be set when such requests are detected. The behavior of the directive can influence how resources are served, particularly for websites aiming to support a broad range of user agents. This can be particularly useful for legacy systems still relying on older browser technologies, ensuring they can receive potential patches or pointers to updated resources instead of being outright denied access.

For instance, if the server determines that the user agent matches the criteria for being classified as an ancient browser, the server can respond with a customized message or redirect to a page advising users to upgrade their browsers. Overall, this directive is a handy tool for web developers aiming to maintain accessibility across a diverse user base.

Config Example

http {
    ancient_browser_value "Upgrade your browser";
}

If not properly configured, ancient browsers may receive default responses that can result in a poor user experience.

Over-reliance on this directive may discourage users from upgrading their browsers, if not handled with a convincing message.

← Back to all directives