end

The 'end' directive in the Secure Token module for NGINX specifies the end time for secure tokens.

Syntaxend time;
Defaultnone
Context
Arguments1

Description

The 'end' directive is a critical component of the Secure Token module for NGINX, particularly utilized for generating secure tokens for content delivery networks (CDNs) such as Akamai. This directive accepts a single argument that indicates the expiration time of the secure token being generated. It works in conjunction with the 'start' directive to define the valid time interval for the token, thereby restricting access to content only within the specified timeframe. By defining both a start and an end time, token usage can be effectively controlled, allowing users access to resources only when intended.

When configuring the 'end' directive, it is important to understand the format of the argument provided. The time can be specified as an absolute time or as a relative time, similar to how the 'start' directive operates. This flexibility enables finer control over the token's validity period, accommodating various operational requirements. The underlying logic in the code computes the absolute end time based on the provided format and ensures that a secure token includes the respective time window when generating the signed token string.

Config Example

secure_token_akamai {
    key some_hex_key;
    start 1620000000;
    end 1620003600;
    param_name token;
    acl "all";
}

Ensure that 'start' is defined before 'end' since the token's validity window is dependent on both.

Using relative times requires correct syntax; otherwise, the default behavior may occur unintentionally.

← Back to all directives