Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a test server with nginx and php-fpm.

Pages on the site are opening correctly, but when I want send POST request for example an "authorize on site" I get "504 Gateway Time-out error". Nginx and php-fpm are configured with default settings.

What could be the reason for the 504 ?

share|improve this question
    
The best way to tackle this problem is to look into nginx-error.log. –  alexus Nov 18 at 16:20

2 Answers 2

That seems to be a pretty common problem, as shown on the past at StackOverflow:

Anyway, for your specific problem I'd say the answer lies in the PHP-FPM configuration. Maybe you should check your php-fpm.conf (if you've got PHP5-FPM, you should check /etc/php5/fpm/pool.d/www.conf or /etc/php5/fpm/php-fpm.conf) and set this parameter:

request_terminate_timeout = 30s

Changing that to lower or higher value could be useful too if things don't work.

share|improve this answer

You can also handle this on the nginx side if nginx is timing out when you are doing your fastcgi pass by using these directives in the stanza with the fastcgi_pass:

fastcgi_connect_timeout 60;
fastcgi_read_timeout 60;

Those would set the connect and response timeout to 60 seconds before nginx would give you the 504.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.