nginx – client request body is buffered to a temporary file

This is a warning, not an error. That’s why it was prefaced with [warn] in the log. It means that the size of the uploaded file was larger than the in-memory buffer reserved for uploads. The directive client_body_buffer_size controls the size of that buffer. If you can afford to have 1GB of RAM always reserved … Read more

How does try_files work?

try_files tries the literal path you specify in relation to the defined root directive and sets the internal file pointer. If you use for instance try_files /app/cache/ $uri @fallback; with index index.php index.html; then it will test the paths in this order: $document_root/app/cache/index.php $document_root/app/cache/index.html $document_root$uri before finally internally redirecting to the @fallback named location. You … Read more

How to disable timeout for nginx?

It may not be possible to disable it at all, yet a feasible workaround is to increase the execution time. On a nginx tutorial site, it was written: If you want to increase time-limit for all-sites on your server, you can edit main nginx.conf file: vim /etc/nginx/nginx.conf Add following in http{..} section http { fastcgi_read_timeout … Read more

How to restart nginx?

The nginx package supplies a /etc/init.d/nginx script that provides the usual start|stop|restart|reload … functionality. /etc/init.d/nginx restart will restart nginx as will service nginx restart Edit Here is a link to a script you can use as /etc/init.d/nginx.

Setting expires headers for static content served from nginx

I prefer to do a more complete cache header, in addition to some more file extensions. The ‘?’ prefix is a ‘non-capturing’ mark, nginx won’t create a $1. It helps to reduce unnecessary load. location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires 30d; add_header Pragma public; add_header Cache-Control “public”; }

Nginx 1 FastCGI sent in stderr: “Primary script unknown”

The error message “primary script unknown” is almost always related to a wrongly set SCRIPT_FILENAME in the nginx fastcgi_param directive (or incorrect permissions, see other answers). You’re using an if in the configuration you posted first. Well it should be well known by now that if is evil and often produces problems. Setting the root … Read more

Can I hide all server / os info?

You can stop it outputting the version of Nginx and OS by adding server_tokens off; to a http, server, or location context. Or if you want to remove the Server header completely, you need to compile Nginx with the Headers More module in, as the header is hard coded in the Nginx source, and this … Read more

error code: 521