Nginx php-fpm fast-cgi 502 Bad Gateway Error Handling

Nginx php-fpm fast-cgi 502 Bad Gateway error is FastCGI problems, resulting in the possibility of error NGINX 502 more.
Some will find on the Internet and 502 Bad Gateway error-related problems and troubleshooting methods listed about, starting with FastCGI configuration to start:
1.FastCGI whether the process has started 2.FastCGI worker process, if not by the number of command view server to open a total number of php-cgi process ps-fe | grep "php" | grep-v "grep" | wc-l
Use the following command to see how many have been used to process php-cgi processes the request tcp netstat-anop | grep "php" | grep-v "grep" | wc-l
Close to the configuration file to set the value, that the number of worker processes set too few see: http://blog.s135.com/post/361.htm
3.FastCGI execution time is too long to increase the following parameters based on actual value fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
4.FastCGI Buffer nginx and apache is not enough, as a front-end buffer limit, you can adjust the buffer parameters fastcgi_buffer_size 32k;
fastcgi_buffers 8 32k;
See: http://www.hiadmin.com/nginx-502-gateway-error% E4% B8% 80% E4% BE% 8B /
5.Proxy Buffer is not enough if you use the Proxying, adjusted proxy_buffer_size 16k;
proxy_buffers 4 16k;
See also: http://www.ruby-forum.com/topic/169040
6.https forwarding configuration error correct configuration server_name www.mydomain.com ;
location / myproj / repos (
set $ fixed_destination $ http_destination;
if ($ http_destination ~ * ^ https (.*)$)
(
set $ fixed_destination http $ 1;
)
proxy_set_header Host $ host;
proxy_set_header X-Real-IP $ remote_addr;
proxy_set_header Destination $ fixed_destination;
proxy_pass http://subversion_hosts ;
)
See also: http://www.ruby-forum.com/topic/169040
http://bizhi.knowsky.com/
7. See php-fpm.log
Error see: http://www.admin99.net/read.php/396.htm
http://hi.baidu.com/dugu2008/blog/item/0d9e9bf8e8c13b08d8f9fd14.html
8.php the bug
See: http://bugs.php.net/bug.php?id=41593
9.php-fpm.conf configuration see http://www.jefflei.com/post/232.html
http://www.php-oa.com/2008/06/05/php-fpm.html
10.nginx.conf the rewrite-url rules 11.php-fpm.pid
I in / php / sbin / php-fpm which the php_fpm_PID = / data1/php/logs/php-fpm.pid modified to # php_fpm_PID = / data1/php/logs/php-fpm.pid
So guess the problem is user permissions have php-fpm.conf in the estimation of the user to start the service would disappear also nginx 400 bad request error of the causes and solutions in nginx.conf in the client_header_buffer_size and large_client_header_buffers all stressed the large, may alleviate this problem.
The main configuration of which is client_header_buffer_size this one, the default is 1k, so less than 1k header, then the problem would not arise.
According to my configuration now is:
client_header_buffer_size 16k;
large_client_header_buffers 4 64k;
This configuration can receive 16k following header, cookie in the browser the maximum number of bytes will be very big, so it is not good to use that maximum value.

分类:OS 时间:2010-03-18 人气:849
分享到:
blog comments powered by Disqus

相关文章

  • Ruby shell command execution method 2010-09-21

    Sometimes necessary to execute commands in the program to complete the operation, execute the command as follows: Exec $ irb >> exec 'echo "hello $HOSTNAME"' hello nate.local $ echo command with the exec method to replace the irb process t

  • Start the computer the 10 common troubleshooting methods 2010-07-17

    Power On Self Test after problems occur when a variety of English phrases, the phrase contains very important information, read this information can solve some small problems, but such a difficult task for some English friends, here is Some of the co

  • sql server 2008 R2 Data-tier Application of database upgrade to provide new methods 2010-05-14

    Database than the application upgrade is always difficult to upgrade. Application upgrade is complete coverage of no more than paper. And upgrade the database file can not simply do the overall coverage, but must take into account the existence of us

  • GWT Introduction Introduction 2010-03-19

    GWT Introduction Introduction GWT Introduction Introduction GWT is the Google Web Toolkit short. GWT is a Java language as a tool in a similar way to write UI components Swing, followed by GWT Compiler Compiler To JavaScritp and HTML in the client br

  • Oracle database listener configuration (very gold content of the article!) 2010-03-04

    Recently many netizens proposed monitoring configuration related issues, the customer terminal (Client) can not connect to the server side (Server). This is configured on the listener to make a brief introduction and some clients can not connect the

  • Oracle database listener configuration 2010-04-20

    Recently many netizens proposed monitoring configuration related issues, the customer terminal (Client) can not connect to the server side (Server). This is configured on the listener to make a brief introduction, and Tichu some customers connect to

  • (Transfer) linux slow to open the mysql query, analysis of a query, why does this query to open? 2010-08-18

    Open the mysql slow query under linux, analysis of a query, why do want to open this query? The database is prone to bottlenecks where discussion now Nosql so hot, it is estimated have been depressed out of the database. mysql speed most affected are

  • High Performance MySQL study notes 2010-09-09

    http://hi.baidu.com/thinkinginlamp/blog/item/d6daa61e9f9acc11413417cc.html High Performance MySQL study notes: find out who holds the lock over the weekend re-re-read "high-performance MySQL", found that some knowledge of point of views will be

  • (R) linux mysql open under the slow query, analysis, query one, why should open this query? 2010-08-18

    Open the mysql slow query under linux, analysis, query one, why should open this query? Database is very easy to create a bottleneck where now Nosql discussion so hot, it is estimated to engage in the database have been depressed. mysql speed is the

  • 50 Tips to Boost ASP.NET Performance 2011-01-04

    When we are looking to optimize the performance of web applications we should keep in mind about Memory Load, Processor Load and Network Bandwidth. Here are 50 best practices to improve the performance and scalability of ASP.NET applications. 1. Page

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.499 (s). 12 q(s)