Hi Drupalars,

We are running two identical Drupal 10 instances — same codebase, same data,
same PHP 8.2 / Apache configuration — with one key infrastructure difference:

- Environment A (NGM): Drupal is accessed directly — no reverse proxy or CDN
in front. Zero AJAX issues observed.

- Environment B (AIOPS): Drupal sits behind Azure Front Door. Intermittent
AJAX failures observed frequently.

Also, in NGM ,
Drupal Version: 10.4.10
Web Server: Apache/2.4.67 (Debian)
Database version: 8.0.44-azure
PHP version: 8.2.32

whereas in AIOPS ,
Drupal Version: 10.4.10
Web Server: Apache/2.4.67 (Debian)
Database version: 8.4.7-azure
PHP version: 8.2.32

**Issue observed in Environment B only:**

1. AJAX requests (form submissions, entity reference autocomplete) return
net::ERR_CONNECTION_CLOSED with HTTP 200 OK — meaning the server sends
the 200 header but drops the connection before the full response body
is delivered.

2. Drupal.AjaxError: "An AJAX HTTP request terminated abnormally.
StatusText: error, ReadyState: 0"

3. The entity_reference_autocomplete endpoint frequently drops mid-response
under moderate load.

4. We also observed the duplicate _wrapper_format=drupal_ajax parameter
issue (tracked in #3364840) appearing specifically during these failures.

**What we have ruled out:**
- Code differences — both environments run identical Drupal code
- Data differences — same content
- PHP configuration — same php.ini settings (max_execution_time: 180,
memory_limit: 8192M)

**Environment B specifics:**
- Azure Front Door sits in front of Drupal
- Request chain header: x-azure-requestchainv2: hops=2
- Apache server address: 169.254.x.x (Azure internal IP)
- reverse_proxy settings in settings.php are currently commented out

**Our question:**
1. Should reverse_proxy and reverse_proxy_addresses be configured in
settings.php when running behind Azure Front Door? Could the missing
reverse proxy configuration cause Drupal to mishandle AJAX responses?

2. Has anyone experienced ERR_CONNECTION_CLOSED 200 OK specifically with
entity_reference_autocomplete behind a CDN/proxy layer?

3. Is there a known interaction between Azure Front Door timeout settings
and Drupal's AJAX system that causes mid-response connection drops?

Any insights would be greatly appreciated.

Drupal version: 10.x
PHP: 8.2.32
Web server: Apache 2.4.68
Infrastructure: Azure App Service behind Azure Front Door

Comments

jaypan’s picture

1. Should reverse_proxy and reverse_proxy_addresses be configured in
settings.php when running behind Azure Front Door? Could the missing
reverse proxy configuration cause Drupal to mishandle AJAX responses?

This is very possible. Users will be accessing the proxy URL, which will then hit the site. It may be that you need to add the proxy server to the trusted host patterns in the Drupal settings. You may also want to examine the HTTP headers being sent, this could give some additional clues as to what to look at.

Contact me to contract me for D7 -> D10/11 migrations.

prakash.thatikonda@gmail.com’s picture

We have configured the proxy server and updated the trusted host patterns in the Drupal settings. However, we're still encountering the same error even after making these changes.

Do you have any other recommendations or suggestions on what we should check next?

jaypan’s picture

The next thing I would do is add a debugger to on the code to see if you can track down what's happening in the background. I'd probably dump this into ChatGPT to see if it has any ideas on what causes this error.

Contact me to contract me for D7 -> D10/11 migrations.