I tried to set up google cloud cdn for my server on google compute engine. I have done everything correct but images on my server are not getting cached. cache hit ratio is n/a. in logs, i am getting 200 status code for http://(ip address)/poweredby.png. So i am assuming fronend ip is not hitting my server but somewhere else. Other than this i can't find any error, all setup is correct. May be i have to change something in my nginx conf file? but idk. Let me know if question is not clear. Thanks,
closed as off-topic by womble♦ Aug 12 at 3:13
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions seeking installation, configuration or diagnostic help must include the desired end state, the specific problem or error, sufficient information about the configuration and environment to reproduce it, and attempted solutions. Questions without a clear problem statement are not useful to other readers and are unlikely to get good answers." – womble
There are a couple things going on here which are causing you issues, to begin with, the server object you are attempting to cache the image from is not on Google’s network: IP 126.96.36.199 is held by Alibaba.
With Cloud CDN, not all HTTP responses are cacheable. Cloud CDN caches only those responses that meet certain requirements. Some of these requirements are specified by RFC 7234, and others are specific to Cloud CDN.
Most notably for your case, the data to be cached would need to be served by a HTTP(S) backend service or backend bucket (inside of Google Cloud) with Cloud CDN enabled. With Cloud CDN you also must use HTTP(S) load balancing (within Google Cloud) as the origin of content cached by Cloud CDN.
You can find more details about CDN used with Google Cloud Platform here.