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 redirects 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 an origin prefix or aliases is 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

I

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.