Difference between revisions of "This Is Your Brain On Informatics: NGINX and Large Files"

From Pathology Education Instructional Resource
Jump to: navigation, search
(Server Timing Parameters)
Line 1: Line 1:
==Need-to-know NGINX Parameters for Large Files==
+
== Need-to-know NGINX Parameters for Large Files ==
  
===Size Parameters===
+
=== Size Parameters ===
<p>
 
 
* ''client_max_body_size''
 
* ''client_max_body_size''
<br />
+
 
 
If you've done the setup as in the blog, this parameter should be located in  
 
If you've done the setup as in the blog, this parameter should be located in  
  
Line 10: Line 9:
  
 
This parameter controls the size of a file that is allowed to be passed through [[This Is Your Brain On Informatics: NGINX|NGINX]].  If a file that is passed to the server is too large, an error of 413 (or something similar will result).  The way to fix that is to change the size of the file that is allowed to be passed to a larger number.  The letter following that number will determine the units where the default (no letter) is bytes, ''k'' is kilobytes, and ''m'' is megabytes (you should not be passing gigabytes to your poor overworked server).
 
This parameter controls the size of a file that is allowed to be passed through [[This Is Your Brain On Informatics: NGINX|NGINX]].  If a file that is passed to the server is too large, an error of 413 (or something similar will result).  The way to fix that is to change the size of the file that is allowed to be passed to a larger number.  The letter following that number will determine the units where the default (no letter) is bytes, ''k'' is kilobytes, and ''m'' is megabytes (you should not be passing gigabytes to your poor overworked server).
</p>
 
  
 
===Server Timing Parameters===
 
===Server Timing Parameters===
<p>
 
 
* ''client_header_timeout''
 
* ''client_header_timeout''
 
* ''client_body_timeout''
 
* ''client_body_timeout''
 
* ''keepalive_timeout''
 
* ''keepalive_timeout''
 
* ''send_timeout''
 
* ''send_timeout''
<br />
+
 
  
 
These parameters should be in the same file as the size parameters.
 
These parameters should be in the same file as the size parameters.
Line 25: Line 22:
  
 
Each one of these modifies how long [[This Is Your Brain On Informatics: NGINX|NGINX]] will deal with part of the process for uploading a file.  Suffice it to say, that if your file upload is somehow timing out (resulting in a 504 gateway timeout error or a 502 general gateway error), these parameters need to be increased in order to allow the file to finish uploading.
 
Each one of these modifies how long [[This Is Your Brain On Informatics: NGINX|NGINX]] will deal with part of the process for uploading a file.  Suffice it to say, that if your file upload is somehow timing out (resulting in a 504 gateway timeout error or a 502 general gateway error), these parameters need to be increased in order to allow the file to finish uploading.
</p>
 
  
===FastCGI Parameters===
+
=== FastCGI Parameters ===
<p>
 
 
* ''fastcgi_read_timeout''
 
* ''fastcgi_read_timeout''
<br />
+
 
  
 
This parameter will only work with something that is using FastCGI (like PHP, or another language).  It is what allows CGI to keep processing the uploaded file.  Again, if the uploaded file is timing out.  This parameter needs to be increased.
 
This parameter will only work with something that is using FastCGI (like PHP, or another language).  It is what allows CGI to keep processing the uploaded file.  Again, if the uploaded file is timing out.  This parameter needs to be increased.
</p>
 
  
  
 
{{Template:This Is Your Brain On Informatics}}
 
{{Template:This Is Your Brain On Informatics}}

Revision as of 02:28, 19 March 2014

Need-to-know NGINX Parameters for Large Files

Size Parameters

  • client_max_body_size

If you've done the setup as in the blog, this parameter should be located in

/etc/nginx/nginx.conf

This parameter controls the size of a file that is allowed to be passed through NGINX. If a file that is passed to the server is too large, an error of 413 (or something similar will result). The way to fix that is to change the size of the file that is allowed to be passed to a larger number. The letter following that number will determine the units where the default (no letter) is bytes, k is kilobytes, and m is megabytes (you should not be passing gigabytes to your poor overworked server).

Server Timing Parameters

  • client_header_timeout
  • client_body_timeout
  • keepalive_timeout
  • send_timeout


These parameters should be in the same file as the size parameters.

/etc/nginx/nginx.conf

Each one of these modifies how long NGINX will deal with part of the process for uploading a file. Suffice it to say, that if your file upload is somehow timing out (resulting in a 504 gateway timeout error or a 502 general gateway error), these parameters need to be increased in order to allow the file to finish uploading.

FastCGI Parameters

  • fastcgi_read_timeout


This parameter will only work with something that is using FastCGI (like PHP, or another language). It is what allows CGI to keep processing the uploaded file. Again, if the uploaded file is timing out. This parameter needs to be increased.