nginx - 将PHP放入TCP而不是套接字

I received error like this bellow:

2014/07/18 15:01:24 [error] 5700#0: *1 upstream sent too big header while reading response header from upstream, client: 1.2.3.4, server: serv_name.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "serv_name.pl"

I know to solve this problem I have to put PHP traffic through TCP instead of sockets. Only for one webb application - we have 12 webs running on nginx at the time. How can I do this only for this one speciefied web app ?

It would be enough to add in /etc/php5/fpm/pool.d directory file web_name.conf ?

What should i put into this file ?


I have to add more information because I messed up a bit. Above error is for SQL requests and there occured parallely error 502 which is connected with socket PHP traffic - thats why I wrote about changing sockets into TCP.

You don't need to switch to TCP... in fact, you will end up with a performance penalty for doing so. All you need to do is increase your buffer sizes.

fastcgi_buffers 16 8k;

You can increase this as needed for your application. You can also change the size of the buffer, but there is no reason to do this as it will automatically pick based on the page size for your system.

http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffers