: This article mainly introduces nginx core module Instruction 1. if you are interested in the PHP Tutorial, refer to it. Alias root
Nginx configuration has two commands for the specified directory: root and alias.
Location/img/{alias/var/www/image/;} # If you follow the preceding configuration, when accessing the files in the/img/directory, ningx will automatically go to the/var/www/image/directory to find the file Location/img/{root/var/www/image;} # If you follow this configuration, when accessing files in the/img/directory, nginx will find the file in the/var/www/image/img/Directory.]
Alias is the definition of a directory alias, while root is the definition of the top-level Directory.
Another important difference is that alias must end with "/". otherwise, files cannot be found, while root can be unavailable.
Client_body_in_file_only
Syntax:
Client_body_in_file_only on | off
Default:
Off
Context:
Http, server, location
If 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_buffer
Syntax:
Client_body_in_single_buffer
Default:
Off
Context:
Http, server, location
This option specifies whether to place the entire request body
A client request buffer. We recommend that you enable this option when using the $ request_body variable to reduce the overhead of the copy operation.
Client_body_buffer_size
Syntax:
Client_body_buffer_size the_size
Default:
8 k/16 k
Context:
Http, server, location
This command specifies the size of the client request body. if the size of the request body exceeds the limit, the whole or part of the request body will be written to the temporary file.
The default size is 2 pages.
Client_body_temp_path
Syntax:
Client_body_temp_path dir-path [level1 [level2 [level3]
Default:
Client_body_temp
Context:
Http, server, location
This option specifies the directory path for storing temporary files requested by the client.
Client_body_timeout
Syntax:
Client_body_timeout time
Default:
60
Context:
Http, server, location
This option specifies the read timeout value for the client request body.
This option takes effect only when the request body cannot be read at a time. if the time is exceeded, the client does not send any data, nginx returns "Request time out" (408 ). error
Client_header_buffer_size
Syntax:
Client_header_buffer_size size
Default:
1 k
Context:
Http, server
This command specifies the buffer size used to store client request headers. The default size is 1 KB, which is sufficient for most requests,
However, if a request header contains a very large cookie or the request is from a wap-client, the 1 K space cannot be accommodated, in this case, nginx will apply for a larger memory space to store the header. the larger buffer size can be obtained through
Large_client_header_buffers command.
Client_header_timeout
Syntax:
Client_header_timeout time
Default:
60
Context:
Http, server
This command specifies the timeout time for nginx to read the Request header. if the time is exceeded, nginx returns "Request time out" (408). Error
Client_max_body_size
Syntax:
Client_max_body_size size
Default:
Client_max_body_size 1 m
Context:
Http, server, location
This command specifies the maximum size of the client Request body. if the size is exceeded, nginx returns the Request Entity Too Large "(413 ). this option must be used with caution to prevent the browser from displaying the error correctly.
Default_type
Syntax:
Default_type MIME-type
Default:
Default_type text/plain
Context:
Http, server, location
This command specifies the default MIME type related to the file
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces the nginx core module Instruction 1, including some content, and hope to be helpful to friends who are interested in the PHP Tutorial.