Nginx 504 Gateway Time-out error with almost zero load

August 25, 2011 by admin · Leave a Comment 

Solve Nginx 504 Gateway Time-out error with almost zero load:

The answer is in my case was to set:

request_terminate_timeout=30s

in php-fpm config.

Note, you can use values other than 30s also.

I used it to match my value in main php.ini file which is:

max_execution_time = 30

Nginx 500 internal server error

August 25, 2011 by admin · Leave a Comment 

Here is a excellent tutorial show you how to solve Nginx 500 internal server error:

Otherwise just try the following in nginx.conf and reload the nginx; this can also solve your problem without making changes at OS level:

Code:
worker_rlimit_nofile 30000;

Nginx Error: 413 Request Entity Too Large

August 25, 2011 by admin · Leave a Comment 

Solve Nginx Error: 413 Request Entity Too Large Howto:

If you get the error “413 Request Entity Too Large” from Nginx client_max_body_size is too low (default is client_max_body_size=1m).

Nginx 400 Bad Request errors

August 25, 2011 by admin · Leave a Comment 

Here is a excellent tutorial show you how to solve Nginx 400 Bad Request errors:

It seems that we need to increase the size of the header space that nginx needs to process headers. The setting for this is large_client_header_buffers, and the size part of this needs to be big enough to handle the entire cookie header being sent.

We set this to 8K and tried again. Still getting errors!

Putting a little test app together to play with cookie sizes, I quickly find the documentation for large_client_header_buffers and see that it works at the http or the server level. Well, it doesn’t work at the server level at all! That’s where we had it. The same setting at the http level works great though!

Setup nginx, ssl, and virtual hosts

August 25, 2011 by admin · Leave a Comment 

Here is a excellent tutorial show you how to Setup nginx, ssl, and virtual hosts:

To install nginx you have a few options depending on the flavour of operating system you are running. You can either install it via a package manager, or download the source and compile it yourself. Using the package manager will mean you will get the latest known stable version for your OS, and have to worry less about working out dependencies or conflicts. However, you may be a version or two behind the official release.

Nginx error – upstream sent too big header

August 24, 2011 by admin · Leave a Comment 

Here is a excellent tutorial show you about Nginx error – upstream sent too big header:

We recently decided to test nginx with our CDN.  It seems that lighttpd just isn’t up the the task of serving high-connection rate services.  It was grinding to a halt on our systems as they started processing 400 – 600 connections per second.  We ended up running multiple lighttpd’s on single servers to alleviate this problem, but in doing so we were losing all the benefits of lighttpd such as stat caching etc.

Enter nginx.  Nginx is another web server similar in nature to lighttpd.  We thought we’d give it a go with just one of our clients which processes in the vicinity of 800 connections per second.  Here is our commentary:
1) nginx seems very well designed and coded – I find the configuration absolutely brilliant and very self explanatory to a developer.  I think a non-developer might have a bit of a hard time with it however, but I’m I’m sure they could work it out.  One of the biggest hates in all the forums is how badly nginx is documented – it’s NOT true.  I found the core features to be very well documented (in English) albeit in various locations.