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

If the function Static Content Delivery is enabled in the Cloudimage Admin panel or the func=proxy is applied at the end of the image URL, then the static content files (like PDFs, CSS, JS) are proxied from the Origin Storage to the CDN Server directly.

 

Sometimes the status code of the proxied file is different than status code 200 - OK. It may be status code 301 - Moved Permanently or status code 404 - File Not Found (check out the status codes)

Please note that this is the status code that the origin server returns, not the status code that comes from the Cloudimage servers.

 

What to do in this scenario?

Execute a curl request using the command:

 curl -I {origin_static_file_url}

Example:

curl -I www.some_file_url.min.js
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

 

Here we can see that the requested URL is www.example_file_url.min.js but the server makes a redirect with status code 301 (Moved Permanently) to Location: https://www.example_file_url.min.js. (please note that the second URL starts with https:// while the first URL does not). 

 

Sample solutions, if you want to avoid redirects: 

  1. Review if there is an origin prefix or aliases applied in the Cloudimage Admin panel. In a scenario where there is an alias or origin prefix and it starts with www. but your Origin server requires https:// , then do the following: 
  • Sign in to the Cloudimage Admin panel.
  • Go under Image Settings.
  • Open the Domains tab.
  • Change the "Origin prefix" OR the related "Alias" value to start with https:// too

In case that you can not find the reason for the issue by yourself, please open a ticket and provide the following details in its content:

  • the URL of the image which shows the issue;
  • a curl request&response like the one described above
  • screenshots or videos if available for the observed problem.

 

 

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

Comments

0 comments

Please sign in to leave a comment.