Home > Backend Development > PHP Tutorial > nginx core module instructions 1

nginx core module instructions 1

WBOY
Release: 2016-07-30 13:32:00
Original
765 people have browsed it
alias root

nginx configuration has two instructions for specifying directories, root and alias

nginx core module instructions 1

location /img/ { alias /var/www/image/; } #若按照上述配置的话,则访问/img/目录里面的文件时,ningx会自动去/var/www/image/目录找文件location /img/ { root /var/www/image; } #若按照这种配置的话,则访问/img/目录下的文件时,nginx会去/var/www/image/img/目录下找文件。]

nginx core module instructions 1

alias is the definition of a directory alias, and root is the definition of the top-level directory .

Another important difference is that alias must end with "/", otherwise the file will not be found, and root is optional

client_body_in_file_onlysyntax: client_body_in_file_only on|offdefault : offcontext: http, server, locationIf this option is on, the client's request body will be written to a file, and the file will not be deleted after the request is processed. , this option can be used for debugging.
client_body_in_single_buffersyntax: client_body_in_single_bufferdefault: offcontext: http, server, location This option specifies whether to put the entire request body in a client end request buffer. When using the $request_body variable, it is recommended to enable this option to reduce the cost of copy operations.

client_body_buffer_sizesyntax: client_body_buffer_size the_sizedefault: 8k/16kcontext: http, server, locationThis directive specifies the size of the client request body , if the size of the request body is exceeded, the entire request body or part will be written to a temporary fileThe default size is 2 pages.

client_body_temp_pathsyntax: client_body_temp_path dir-path [ level1 [ level2 [ level3 ]default: client_body_temp context: http, server, locationThis option specifies The path to the storage directory used to store temporary files requested by the client

client_body_timeoutsyntax: client_body_timeout timedefault: 60context: http, server, location This option specifies the read timeout of the client request body Time This option will only take effect if the request body cannot be read in one read. If the time exceeds and the client does not send any data, nginx will return "Request time out" (408) .Error

client_header_buffer_sizesyntax: client_header_buffer_size sizedefault: 1kcontext: http, server This directive specifies the buffer used to store client request headers size. The default size is 1k, which is enough for most requests. However, if a request header contains a very large cookie, or the request comes from a wap-client, then 1k space cannot accommodate it. At this time, nginx will apply for a larger memory space to store the header. The size of this larger buffer can be specified through the large_client_header_buffers command.


client_header_timeoutsyntax: client_header_timeout timedefault: 60context: http, serverThis directive specifies the timeout for nginx to read request headers time, if it exceeds that time, then nginx will return "Request time out" (408). Error
client_max_body_sizesyntax: client_max_body_size sizedefault: client_max_body_size 1m context: http, server, location This directive specifies the maximum space for the client request body. If this size is exceeded, nginx will return Request Entity Too Large" (413). Error, you need to use this option with caution to avoid the possibility that the browser The error cannot be displayed correctly. _type text/plaincontext: http, server, location
This directive specifies the default MIME type associated with the file
Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission. The above introduces the nginx core module command 1, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template