Cloudways changed this NGINX setting to allow larger HTTP headers by the server:
large_client_header_buffers 16 128k;
Now it works, but only if I disable proxying via Cloudflare by changing the A record in the Cloudflare DNS. I am now waiting for Cloudflare Support to see why they still reject the page.
I was able to make a HAR file with Cloudflare completely by-passed, and one with Cloudflare enabled. You'll find them here: hidden link
I'd appreciate it if you'd take a look. Because I noticed something strange. This section below is in the HAR files 300 times!
That can't be good, right? It may be the root of this issue. I think it has something to do with the code we discussed, and executing that code a lot of times on the same page. It looks like it sets a new cookie each time, causing a huge header.
Cloudflare may get back to me saying that they accept a fixed max header, and can't change that. Which would mean the header must be limited on our end.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+02:00)
Hi Arno,
indeed, it seems that the large headers are breaking some part of the "proxy chain" with the environments (too large).
We checked it, and this cookie is set by us when the method $wpml_request_handler->set_language_cookie is used in $sitepress->switch_lang, which is called from the problematic hook do_action('wpml_switch_language', $current_language_code);. This confirms that the header issue is directly related to your snippet.
We will handle this via our code as a minor issue, but it will be better for the time being to use the alternative switch_to_locale as the code that you are using is creating the issue.
Languages: English (English )Spanish (Español )German (Deutsch )
Timezone: Europe/Madrid (GMT+02:00)
Hi Arno,
the issue is still unresolved and is currently being treated as a minor one. Unfortunately, I can't provide an ETA, but I’ll keep you updated as things progress.