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

sponsored links
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:
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: 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:
6.https forwarding configuration error correct configuration server_name ;
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:
7. See php-fpm.log
Error see:
8.php the bug
9.php-fpm.conf configuration see
10.nginx.conf the rewrite-url rules
I in / php / sbin / php-fpm which the php_fpm_PID = / data1/php/logs/ modified to # php_fpm_PID = / data1/php/logs/
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.
  • StumbleUpon
  • Digg
  • TwitThis
  • Mixx
  • Technorati
  • Facebook
  • NewsVine
  • Reddit
  • Google
  • LinkedIn
  • YahooMyWeb

Related Posts of Nginx php-fpm fast-cgi 502 Bad Gateway Error Handling

  • Do not believe mongrel_rails cluster:: start!

    Update code after Action (No action responded to xxx) error. Check the code, has been updated. Change the action name, change the path is always error. Baffled. In the system under ps ax | grep mongrel, found that Mongrel can not find the process! Bu ...

  • extjs development environment set up and practice

    1, download and extract the extjs 2, download eclipse and Eclipse AJAX Toolkit Framework (ATF) I have been accustomed to using eclipse as a development environment, a variety of open-source plugin so that eclipse has all-around performance, operating effi

  • hibernate Technical Study Notes (first)

    Introduction: Model does not match (impedance mismatch) java object-oriented language, object model, its key concepts are: inheritance, association, polymorphism, etc.; database is the relational model, its key concepts are: tables, primary keys, for ...

  • Rails2.0.2 change the default DB adpter

    In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpter default is set become the sqlite3. Check the ra ...

  • Answer: After 2.2 upgrade mysql question-driven

    windows installed after the mysql gem error, error is approximately: ArgumentError (NULL pointer given): (eval): 3: in `each_hash ' (eval): 3: in `all_hashes' This is feeling under the windows of the question if the mysql gem version libmysql ...

  • ROR resources

    Ruby Web site resources: ruby official website: ruby doc official website: rubyonrails official website: programming ruby online edition (Ruby studying the "Bible") ...

  • hibernate using c3p0 connection pooling

    Private c3p0 for open source's JDBC connection pool, with the release hibernate. This article describes how to use the hibernate configuration in c3p0. c3p0 connection pool configuration is v ...

  • Hibernate configuration parameters

    Hibernate in the configuration file: <properties> <property name="" value="create" /> </ properties> Parameter Description: validate load hibernate, the authentication to create a database t ...

  • In the servlet use Bean

    According to Sun's definition, JavaBean is a reusable software components. In fact JavaBean is a Java class, through the package into a property and methods of treatment of a function or a business object, referred to as bean. Because JavaBean is ...

  • Hibernate secondary cache

    Hibernate cache: 2-bit cache, also known as process-level cache or SessionFactory level cache, secondary cache can be shared by all of the session Cache configuration and the use of: Will echcache.xml (the document code in hibernate package directory ...

blog comments powered by Disqus
Recent Entries
Tag Cloud
Random Entries