Add CORS to Nginx on AWS Elastic Beanstalk
Apache Add the following block to your .htaccess file: <FilesMatch ".(eot|otf|ttf|woff|woff2)"> Header always set Access-Control-Allow-Origin "*" </FilesMatch> Nginx Add the following location block to your virtual host file (usually within the server directive) and reload Nginx: location ~* \.(eot|otf|ttf|woff|woff2)$ { add_header Access-Control-Allow-Origin *; } Invalidate CloudFront Distribution Once the changes have been made you will need to invalidate the CloudFront cache with a path of “/*”. Integrating to CloudFront service It’s simple to config and use CloudFront (a CDN service) for Rails app. Just one thing from my experience, regarding to CORS issue on EB when your CSS want get loading font files or font-awesome. Because EB run your app with Nginx server serve public static files, then work around would be overwriting web server config in Nginx with add_header Access-Control-Allow-Origin ‘*’...