start

Defines the starting time for secure tokens generated by the NGINX Secure Token module.

Syntaxstart time;
Defaultnone
Context
Arguments1

Description

The start directive in the Secure Token module for NGINX is used to set the start time of the secure token's validity period. This directive accepts a single argument that specifies the start time, which can be an absolute timestamp or a relative time (in seconds) from the epoch. This is important for ensuring that the generated token provides a time window during which it is valid, hence mitigating unauthorized access to content served through a CDN.

When configuring start, it is common to couple it with the end directive, which determines the expiration of the token's validity. Together, these parameters define the lifetime of the token, allowing operators to enforce time-based access control on content delivered via streaming protocols. If the start parameter is set as relative, the actual start time will be calculated as the current NGINX server time plus the relative value specified. This feature is especially important in scenarios where tokens need to be dynamically generated based on the time of request.

The start parameter is interpreted at the time the token is created; thus, developers must ensure that their timestamps align with their access policy. Misconfiguration can lead to tokens that are either valid before intended or are invalid due to an expired window.

Config Example

secure_token_akamai {
    key your_token_key;
    start 120; # Token is valid starting 120 seconds from the current time
    end 300;   # Token is valid until 300 seconds from now
    param_name token;
    acl some_acl_rule;
}

Ensure the start time is not set in the past; otherwise, the token will be immediately invalid.

When using relative times, ensure that the values are correctly calculated. Incorrect values could lead to overly short or long validity periods.

Always verify the interplay of start and end to prevent creating overlapping or confusing token lifetimes.

← Back to all directives