I have setup a discourse version v2.3.0.beta2 installation on AWS.
This attachment shows how I have it deployed. I’m using the official docker image installation on each instance of the auto scaling group
I have 2 CloudFront distributions
One (cdn.civicxclub.com) pointing to the S3 buckets for serving the uploaded images directly from the CDN. THIS WORKS.
The other one (civicxclub.com) pointing to the balancer, in order to serve the app and all the static files from it. THIS DOESN’T WORK
This is the behaviours configuration that I have:
The default one has Cache Based on Selected Request Headers option set to All in order to not allow caching from the backend.
All the others has Cache Based on Selected Request Headers set to *Whitelist and I whitelist Host, Origin and Referer headers.
When I access the web from the browser and inspect headers from for example an avatar It always says Miss from cloudfront, but when I access the file twice directly from the brownser, it says Hit from cloudfront, so the caching is working, but not when loading files from the forum web page.
The Discourse CDN Variable is set:
Thanks in advance, regards.