$google

The $google variable returns information about the Google mirror configuration based on the request context. — NGINX Module for Google Mirror creation

$google NGINX Module for Google Mirror creation

Description

The $google variable is part of the NGINX Module for Google, specifically designed to facilitate the deployment of Google mirror sites. This variable is dynamically set during the processing of requests that have been configured with the `google` directive in the NGINX configuration. When a request is handled, the variable is populated with relevant information that determines if the request is being processed as a Google mirror, which allows NGINX to adjust its behavior accordingly. This value is typically a string indicating the status of the Google filter and can vary depending on the particular configuration and the specific request being handled. When the `google` directive is enabled in a location block, as shown in the practical example below, the $google variable can change based on whether additional configurations for features like Google Scholar or language settings are activated. It is particularly useful when combined with conditionals or for logging purposes in order to debug or verify that requests are being correctly mirrored as specified. Typical values include enabled states or specific identifiers relevant to the mirror operation, ensuring streamlined handling of Google’s resources.

Config Example

location / {
    google on;
    error_log  /var/log/nginx/google_error.log;
    access_log /var/log/nginx/google_access.log google;
}

Subsystem

http

Cacheable

No

Contexts

http, server, location

Ensure that the `google` directive is properly configured in the location block; otherwise, the variable may not be set as expected.

This variable is sensitive to context and may not work outside of designated contexts like location or server blocks.

Be cautious when using this variable in conjunction with caching mechanisms, as its dynamic nature may lead to stale responses being served if not properly accounted for.