Why the proxied static files are returning status code different than 200?

If Static Content Delivery is enabled in the Cloudimage Admin panel, or the parameter func=proxy is added to the end of an image URL, static files (such as PDF, CSS, or JS files) are proxied directly from the Origin Storage to the CDN server.

In some cases, the proxied file may return a status code different from 200 OK. For example:

  • 301 – Moved Permanently

  • 404 – File Not Found

These status codes are returned by the origin server, not by the Cloudimage servers.

 

How to Check the Origin Response

To verify the response coming from the origin server, run the following command:

curl -I {origin_static_file_url}

Example:

curl -I www.some_file_url.min.js

Example response:

HTTP/1.1 301 Moved Permanently
Date: Wed, 18 Aug 2021 10:24:32 GMT
Server: Apache
Strict-Transport-Security: max-age=15552001; includeSubDomains;
Location: https://www.some_file_url.min.js
Cache-Control: max-age=1
Expires: Wed, 18 Aug 2021 10:24:33 GMT
Content-Type: text/html; charset=iso-8859-1

In this example, the requested URL is:

www.example_file_url.min.js

However, the server returns a 301 redirect to:

https://www.example_file_url.min.js

The difference is that the redirected URL uses HTTPS, while the original request does not.

 

How to Avoid Redirects

To prevent redirects, check the Origin Prefix or Alias configuration in the Cloudimage Admin panel.

If the origin server requires HTTPS, make sure the configured origin URL also starts with https://.

Steps:

  1. Sign in to the Cloudimage Admin panel.

  2. Go to Image Settings.

  3. Open the Domains tab.

  4. Update the Origin Prefix or the related Alias so it starts with https://.

This ensures the request is sent directly to the correct URL and avoids unnecessary redirects.

 

If you have any questions or issues, please feel free to contact our Software Engineer and mention the following details:

  • Token
  • Short description of the issue (including URLs, screenshots, and a short video if available)
  • Steps to reproduce the issue.

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.