Despite sending an async request to the server over AJAX, the server will not respond until the previous unrelated request has finished. The following code is only broken in this way on Nginx, but runs perfectly on Apache.
This call will start a background process and it waits for it to complete so it can display the final result.
$.ajax({
type: 'GET',
async: true,
url: $(this).data('route'),
data: $('input[name=data]').val(),
dataType: 'json',
success: function (data) { /* do stuff */}
error: function (data) { /* handle errors */}
});
The below is called after the above, which on Apache requires 100ms to execute and repeats itself, showing progress for data being written in the background:
checkStatusInterval = setInterval(function () {
$.ajax({
type: 'GET',
async: false,
cache: false,
url: '/status?process=' + element.attr('id'),
dataType: 'json',
success: function (data) { /* update progress bar and change status messages */ }
});
}, 1000);
Unfortunately, when this script is run from nginx, the above progress request never even finishes a single request until *after* the first AJAX request that sent the data gets it's own response.
Basically, it appears that the nginx server can only handle 1 open request at a time on Windows. I don't have this problem at all on Linux production servers.
Is there anyway to configure nginx so I can use it on my local Windows 8.1 development server?