ARTIFACTORY: How to deal with pushing larger images failure in Artifactory with Nginx as a reverse proxy

ARTIFACTORY: How to deal with pushing larger images failure in Artifactory with Nginx as a reverse proxy

AuthorFullName__c
Elumalai Ganesan
articleNumber
000005848
FirstPublishedDate
2023-08-28T15:02:07Z
lastModifiedDate
2025-07-22
VersionNumber
1

Whenever a large file or image is failing to be pushed into Artifactory when using Nginx reverse proxy, here are the few parameters that we need to tune to accommodate larger files or images push calls.

As Nginx is the reverse proxy involved, it is responsible for receiving the data from the client and sending it to the backend server (Artifactory).

Parameters to be tuned:
 

proxy_buffering     off;
proxy_request_buffering off;
proxy_http_version  1.1;
proxy_max_temp_file_size 0; 
client_max_body_size 0;
proxy_read_timeout  3600;
proxy_send_timeout  3600;

proxy_buffering:

This directive governs whether Nginx should buffer responses from the proxied server before transmitting them to the client.

When set to "off," Nginx avoids buffering the response and immediately forwards data from the backend server to the client upon receipt, foregoing the accumulation of the entire response.
proxy_buffering off;

proxy_request_buffering:

In situations involving extensive file uploads, it may prove impractical to buffer the complete request body in memory.

NGINX buffers the client's request in memory before dispatching it to the backend server. For substantial files, it's advisable to configure NGINX to write the request directly to disk, utilizing the "proxy_request_buffering" directive set to "off." This approach prevents excessive memory consumption and ensures efficient management of substantial file uploads.
proxy_request_buffering off;

proxy_http_version:

Adopting HTTP/1.1 is standard practice, yielding numerous advantages over preceding versions. These include heightened support for keep-alive connections, more resource-efficient TCP connection utilization, and compatibility with features like chunked encoding for enhanced handling of extensive data transfers.

In scenarios where HTTP/1.1 chunked transfer encoding is employed to transmit the initial request body, buffering of the request body persists regardless of the directive's value, unless explicit HTTP/1.1 proxying is enabled.
proxy_http_version 1.1;
proxy_max_temp_file_size:
proxy_max_temp_file_size 0;

Client_max_body_size:

Adjust the "client_max_body_size" parameter within the NGINX configuration to accommodate the maximum size of the client's request body. Configure this value to accommodate the dimensions of the substantial file you intend to transmit.
client_max_body_size 0;

A setting of 0 indicates unrestricted size.

proxy_max_temp_file_size:

The "proxy_max_temp_file_size" directive in Nginx dictates the upper limit for temporary file sizes created during proxying of requests to backend servers.
proxy_max_temp_file_size 0;

proxy_read_timeout:

"proxy_read_timeout" is a configuration directive commonly employed in web server setups, particularly within reverse proxy configurations. It designates the maximum interval the reverse proxy server should await a response from the upstream (origin) server before deeming the connection timed out and terminating the request.

proxy_send_timeout:

Analogously, the "proxy_send_timeout" directive is another configuration parameter often used in reverse proxy scenarios within web server configurations. It defines the utmost duration the reverse proxy server will await while transmitting data to the upstream (origin) server. In essence, it governs the timeout duration for data transmission from the reverse proxy server to the backend server.

By fine-tuning the aforementioned parameters in your "artifactory.conf" file, the capability to transmit and receive larger images will be facilitated, devoid of connection drop issues when interfacing with the Artifactory server.