# 504 Gateway Time-out

**URL:** <https://www.ruby-forum.com/t/504-gateway-time-out/212037>\
**Category:** NGINX\
**Created:** [September 20, 2011, 5:13pm UTC](https://www.ruby-forum.com/t/504-gateway-time-out/212037 "2011-09-20T17:13:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 20, 2011, 5:13pm UTC](https://www.ruby-forum.com/t/504-gateway-time-out/212037/1 "2011-09-20T17:13:38Z")

</div>

I have a php script which takes too long to be executed (a form for  
uploading large files). Upong running this I get “504 Gateway Time-out”  
error. Since I do not want to update php.ini for the whole server, I put  
set\_time\_limit(0); at the top of my php script; but still I get the same  
time-out error. What is the problem? I’m on Nginx 1.0.4.

Posted at Nginx Forum:

> **[504 Gateway Time-out](https://forum.nginx.org/read.php?2,215445,215445#msg-215445)**
>
> I have a php script which takes too long to be executed (a form for uploading large files). Upong running this I get "504 Gateway Time-out" error. Since I do not want to update php.ini for the whole server, I put set\_time\_limit(0); at the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [September 20, 2011, 5:27pm UTC](https://www.ruby-forum.com/t/504-gateway-time-out/212037/2 "2011-09-20T17:27:16Z")

</div>

Hi,

Search the manual for the following directives:

http {

[…]  
client\_header\_timeout 10m;  
client\_body\_timeout 10m;  
send\_timeout 10m;

fastcgi\_read\_timeout 600;  
fastcgi\_send\_timeout 600;

}

Then experiment and specify values that are appropriate for your server  
or virtual host.

Andrejs

Posted at Nginx Forum:

> **[Re: 504 Gateway Time-out](https://forum.nginx.org/read.php?2,215445,215446#msg-215446)**
>
> I have a php script which takes too long to be executed (a form for uploading large files). Upong running this I get "504 Gateway Time-out" error. Since I do not want to update php.ini for the whole server, I put set\_time\_limit(0); at the...

---

<div class="post-metadata">

**Author:** ![etrader](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@etrader](https://www.ruby-forum.com/u/etrader)\
**Post date:** [September 20, 2011, 8:44pm UTC](https://www.ruby-forum.com/t/504-gateway-time-out/212037/3 "2011-09-20T20:44:52Z")

</div>

Thanks locojohn! It perfectly worked 🙂

Posted at Nginx Forum:

> **[Re: 504 Gateway Time-out](https://forum.nginx.org/read.php?2,215445,215453#msg-215453)**
>
> I have a php script which takes too long to be executed (a form for uploading large files). Upong running this I get "504 Gateway Time-out" error. Since I do not want to update php.ini for the whole server, I put set\_time\_limit(0); at the...
