I'm having issues getting current WordPress (5.5, but confirmed back until at least 5.2) working behind CloudFront, and am wondering what the current best practice is for Behavior configuration. Looking at the latest documentation and problems I can find (Best Practices for WordPress on AWS, dated from October 2019; this question, looking for similar sorts of debugging advice; and this blog post from December 2018, which I found via this question), I have the following configuration:

                        /wp-login.php           /wp-admin/*     /wp-json/*      Default (*)
Viewer Protocol Policy  HTTP->HTTPS             HTTP->HTTPS     HTTP->HTTPS     HTTP->HTTPS
Allowed HTTP Methods    all                     all             all             all
Cached methods          GET, HEAD,              GET, HEAD,      GET, HEAD,      GET, HEAD,
                          OPTIONS                 OPTIONS         OPTIONS         OPTIONS
Cached Headers          Whitelist               all             Whitelist       Whitelist
                          Host                                    Host            Host
                          Options                                 Options         Options
Object Caching          Origin                  n/a             Custom          Custom
                                                                  Min 0           Min 0
                                                                  Max 31536000    Max 31536000
                                                                  Default 60      Default 60
Forward Cookies         Whitelist               all             all             Whitelist
                          comment_author_*                                        comment_author_*
                          wordpress_*                                             wordpress_*
                          wp-settings-*                                           wp-settings-*
Query string            Forward all,            Forward all,    Forward all,    Forward all,
                          cache all               cache all       cache all       cache all
Auto compress           Yes                     Yes             Yes             Yes

I keep seeing lots of little issues, but the most conspicuous one is that the editor doesn't work properly — at a minimum, one can not add blocks. See this screenshot:

WordPress block editor not working

My environment is CloudFront <-> Load Balancer <-> EC2 instance. If I remove CloudFront from the equation, things work:

WordPress block editor working

Clearly, CloudFront is causing a "problem"; however, other than in behavior, the problem is not evident — I'm not seeing anything in log files, nor with WP_DEBUG enabled, nor in the browser console ... everything seems to be working just fine, even though it clearly isn't.

So, ideally, I'd like to see what other people are actually using for fresh installs of WordPress behind CloudFront these days; or, alternatively, I'd take any suggestions on how to further debug this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.