pta_enable

Enables or disables the Period of Time Authentication (PTA) for a specific location in NGINX.

Syntaxpta_enable on | off;
Defaultoff
Contextlocation
Argumentsflag

Description

The pta_enable directive is part of the Period of Time Authentication module for NGINX, which allows for secure access control to content by checking encrypted tokens in query strings or cookies. When this directive is set to 'on' in a specific location block, NGINX will validate incoming requests against an encrypted string that contains a CRC32 checksum, an expiration time, and the requested URI path. This validation helps to ensure that only authorized access is granted based on the token's validity and the specified time frame.

The directive works in conjunction with several other configurations, such as pta_1st_key, pta_1st_iv, pta_2nd_key, and pta_2nd_iv, which establish the cryptographic keys and initialization vectors necessary for decrypting the PTA token. When the directive is not enabled ('off'), the request will bypass the authentication checks, allowing unrestricted access to the specified location. This makes pta_enable critical for securing routes that require time-sensitive access controls.

To utilize this directive, it's essential to configure the PTA module properly by specifying the cryptographic keys, which are used during the handling of requests to create and validate the PTA tokens. Misconfiguration can lead to inconsistent behavior in access constraints and potential security vulnerabilities.

Config Example

location /foo/ {
    pta_enable on;
}

Ensure that the PTA keys and IVs are correctly specified; incorrect values will prevent successful decryption.

Be mindful of the expiration time set within the PTA token; requests outside this timeframe will be denied access.

If this directive is not set to 'on', all requests to the location will be allowed without authentication.

← Back to all directives