Q:

NginX and Php-Fpm on docker

I have an official docker NginX container (NginX:latest) connected to official Php-Fpm (php:7.2-fpm) based container using bind mount for config and source code (for testing purpose). They are communicating through FastCGI. I'm running Docker Edge for Windows 2.0.0. (engine 18.09).
The php app is serving html pages and there are some XHR requests on every page to get JSON data from the same app.
Everything work well except the second XHR request generates an error. The page itself loads, then within the document ready  event two XHR requests are being processed, but only one of them (most often the first) finishes with success and the second one causing 404 error.
Response contains No input file specified. error and docker console shows these errors:
Php-fpm:
WARNING: [pool www] child 8 said into stderr: "ERROR: Unable to open primary script: /var/www/html/web/app.php (No such file or directory)"
Nginx:
*235 FastCGI sent in stderr: "Unable to open primary script: /var/www/html/web/app.php (No such file or directory)" while reading response header from upstream, client: 192.168.16.2, server: my-server.com, request: "GET /cli/cli_har_rc.php?EVENT=GET&THREAD=2 HTTP/1.0", upstream: "fastcgi://192.168.16.3:9000", host: "my-server.com", referrer: "https://my-server.com/cli/cli_har.php"
Which is odd because the file exists and when I use the same request in separate browser tab it works well. It also sometimes happens that requests' order is interchanged by browser and only the first one has success no matter which one it is.
It seems like the requests concurrency plays the role.
NginX site.conf:
server {
    set $request_url $request_uri;

    listen 80;
    server_name my-server.com;
    root /var/www/html/web;

    location / {
        try_files $uri /app.php?$args;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass fpm_cw:9000;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root/app.php;
        fastcgi_param SCRIPT_NAME /app.php;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param REQUEST_URI $request_url;
    }
}

When I put some time distance to XHR request call (1-2s) it works as expected. It seems to be problem with some processing delays within docker on windows processing. I am yet to check it on Linux machine.

A:

The problem was caused by combination of Docker bind mounts on windows. I didn't go further, but it seems the problem is solved on production machine with production container where are no bind mounts but whole project copied in build time.

