upload_progress_content_type

The `upload_progress_content_type` directive sets the content type for the upload progress response in NGINX.

Syntaxupload_progress_content_type string;
Defaultnone
Contexthttp, server, location
Arguments1

Description

The upload_progress_content_type directive specifies the Content-Type header for the responses generated by the upload progress tracking module. When tracking file uploads, this module allows NGINX to monitor and report on the status of POST uploads via a unique identifier. By setting this directive, you can customize the response format (such as JSON, XML, etc.), enabling better integration with front-end applications that may require a specific content type for parsing progress data.

This directive should be placed within the http, server, or location context, making it flexible depending on how wide you want the effect to be. The argument expected is a string representing the desired content type. If not set, the default behavior will be to use NGINX’s built-in defaults based on context, which might not be suitable for all applications.

Config Example

location /upload {
    upload_progress on;
    upload_progress_content_type application/json;
}

Ensure that the specified content type matches what your front-end expects or can handle.

Misconfiguration may lead to unexpected response formats, causing integration issues.

If not specified, NGINX may use a default content type that does not match your application's needs.

← Back to all directives