I'm using AWS CloudFront with Magento 2.4. When dev/static/sign is disabled, I have absolutely no issues with the CDN. When dev/static/sign is enabled though, all static resources are redirected to the origin url.

I've tried this and this, with no success.

Has anyone encountered this?

有帮助吗?

解决方案

I've found the solution to this issue.

My web root is MagentoDir/pub. In pub/static/.htaccess, the RewriteBase was set to /pub/static. When I changed that value to /static/, restarted apache and flushed Magento's caches, the problem was solved.

许可以下: CC-BY-SA归因
scroll top