ARTIFACTORY: How to solve the garbled codes response when using /api/archive/download in browser

ARTIFACTORY: How to solve the garbled codes response when using /api/archive/download in browser

Products
Frog_Artifactory
Content Type
Use_Case
AuthorFullName__c
Ruilin Fan
articleNumber
000006324
FirstPublishedDate
2025-01-08T13:09:44Z
lastModifiedDate
2025-08-04
VersionNumber
3
Introduction 

Artifactory support reverse proxy through nginx server and here is the configuration guideline;

When using API ‘api/archive/download’ in the browser to access nginx server that proxies one Artifactory server to download a folder to a zip package, there will be garbled codes in the response to return.

For instance:
User-added image 


Resolution 

Directly to resolve:

Locate the configuration file of the nginx server and find the nginx.conf file(Default: /etc/nginx/conf.d/nginx.conf).

vim nginx.conf;

Then to find the below line to annotate it and save and exit;

It is a default configuration line of  a reverse proxy snippet generated by Artifactory.

*******
#add_header X-Content-Type-Options "nosniff" always;
*******

Reload nginx;

 nginx -t
 nginx -s reload

Then downloading the folder by the same api request in the browser will be successful.


Indirectly to resolve:

Using curl command with -o option

curl -uadmin:password -XGET "http://localhost/artifactory/api/archive/download/docker-images/composer?archiveType=zip" -o composer.zip