Search code examples
phpajaxnginxmootoolsopensuse

404 Not Found after a long AJAX request


I have a function that sends a large amount of emails out in one go.

Submit Form -> AJAX Request -> send emails function -> Echo a response

When the request takes around 30 seconds, all is well, my request returns the data I need and I can continue. When the request takes longer (around 2 minutes or more) the response comes back as a 404 Not found.

I've tried debugging the section of code that echo's my response, but it never gets hit. Thought maybe it was timing out, so...
Tried increasing max_execution_time and max_input_time in php.ini.
Tried increasing the keepalive_timeout in nginx.confd.

All of the emails are getting sent regardless of this 404, my php file just doesn't send the response when the request is done (unless as previously stated it doesn't take long due to small batch of emails)

Website running with openSUSE 12.2, php-fpm 5.4, nginx, MooTools, no php framework sending emails with PEAR mail::factory

Server wasn't set-up by me, I am a new employee at a company

Willing to attempt any suggestions...


Solution

  • Figured out my problem, NGINX had the following setting

    fastcgi_read_timeout 120;
    

    It was timing out my request. Realized it as I was writing my question and wrote php-fpm