MindMap Gallery Nignx
Nginx is a high-performance HTTP and reverse proxy web server that also provides IMAP/POP3/SMTP services.
Edited at 2024-01-19 10:26:42This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
Nignx
use
Order
-c
Specify the configuration file default path --conf-path
-p
Specify nginx installation directory
-g
Temporarily specify some global configuration items to make the new configuration items take effect
nginx -g "pid /var/nginx/test.pid"
Restrictions:
The configuration items cannot conflict with nginx.conf in the default path, otherwise it cannot be started.
When the nginx service started in -g mode executes other commands, it is necessary to bring -g, otherwise the configuration items may not match.
-t
Test the configuration file for errors
-s
Send signals: stop, quit, reopen, reload
Configuration
Debugging and locating problems
daemon on | off;
Whether to run in daemon mode
master_process on | off;
Whether to work in master/woker mode
off; the master process handles the request itself
error_log /path/file level;
Log settings
debug_points [stop | abort]
stop: Send SIGSTOP signal to the code debugging point for debugging
abort: Generate a coredump file, you can use gdb to view the information
debug_connection [IP | CIDR]
This configuration item actually belongs to the event class configuration events { } and is only valid
worker_rlimit_core size;
Limit coredump core dump file size
working_directory path;
Specify coredump file generation directory
Note: If the log level is set to debug, you must configure the --with-debug configuration item when compiling.
Configuration items for normal operation
env VAR|VAR=VALUE
Define environment variables
include /path/file;
Embed other configuration files
pid path/file;
pid file path
user username [groupname];
The user and user group under which the nginx worker process runs
worker_rlimit_nofile limit;
The maximum number of file handles that can be opened by a worker process
worker_rlimit_sigpending limit;
Limit signal queue
Configuration items to optimize performance
worker_processes number
The number of nginx worker processes; the optimal number is the number of CPU cores;
worker_cpu_affinity cpumask [cpumask...]
Bind the nginx worker process to the specified cpu core; only supports Linux systems
ssl_engin device
SSL hardware acceleration; openssl engine -t
timer_resolution t
Execution frequency of system call gettimeofday
worker_priority nice
nginx worker process priority setting
Event class configuration items events
accept_mutex [on|off]
Whether to open the accept lock; load balancing lock
lock_file path/file;
path to lock file
accept_mutex_delay Nms;
The delay time between using the accept lock and actually establishing the connection
multi_accept [off | no]
Establish new connections in batches
use [kqueue | rtsig | epoll | /dev/poll | select | poll | eventport]
Select event model
worker_connection number;
Maximum number of connections per worker
http {}
server {}
location [ = | ~ | ~* | ^~|@] /uri/ {}
root path
Set resource path in root mode
alias path
Set the resource path in alias mode
index file...
Visit home page
error_page code [ code...] [ = | =answer-code] uri | @named_location
Redirect pages based on HTTP return code
recursive_error_page [off | on]
Whether to allow recursive use of error_page
try_files path1 [path2] uri
Try to obtain valid paths in order, if all are invalid, return uri
listen address:port [ default | default_server | backlog=num | rcvbuf=size | sndbuf=size | accept_filter=filter| deferred | bind | ipv6only=[on|off] | ssl]
server_name name [...]
host name
server_names_hash_bucket_size size
nginx uses a hash table to store the server name; set the memory size occupied by each hash bucket
server_names_hash_max_size size
Hash table collision rate
server_name_in_redirect on | off;
Redirect host name handling
nginx.conf
Memory and disk resources
client_body_in_file_only off | clean | on
Used for debugging and locating problems
client_body_in_single_buffer off | on
The HTTP packet body in the request is always stored in the memory buffer. If it exceeds client_body_buffer_size, it is written to the disk file.
client_header_buffer_size size
nginx allocates the memory buffer size when accepting the HTTP header part of the request
large_client_header_buffers number size
The number of buffers and the size of each buffer to store extremely large HTTP headers
client_body_buffer_size size
Memory buffer size to store HTTP packet body
client_body_temp_path dir_path [ level1 [ level2 [ level3 ]]]
Temporary storage directory for HTTP packet bodies
connection_pool_size size
Connection memory pool size
request_pool_size size
Allocate memory pool size per request
Network connection configuration
client_header_timeout time
Timeout for reading HTTP headers
client_body_timeout time
Timeout for reading HTTP body
send_timeout time
Send response timeout
reset_timeout_connect off | on
Whether to reset the connection after the connection times out
lingering_close on | off | always
Control nginx to close user connection mode
lingering_time time
Useful for uploading large files when lingering_close is enabled
lingering_timeout time
After lingering_close takes effect, check the data before closing the connection.
keepalive_disable [ mise6 | safari | none] ...
Disable keepalive functionality for some browsers
keepalive_timeout time
keepalive timeout
keepalive_requests n
The maximum number of requests allowed to be carried on a keepalive connection
tcp_nodelay on | off
Determine whether to use TCP_NODELAY for keepalive connections
tcp_nopush off | on
Turn on tcp_nopush and put the entire response header into a TCP packet when sending a response.
MIME type settings
types {...}
Mapping of MIME types and file extensions
default_type MIME-type
HTTP header Content-Type is used by default
types_hash_bucket_size size
The memory size occupied by each Sanli pain
types_hash_max_size size
Hash table collision rate
Limitations on client requests
limit_except method ... { ... }
Limit requests by HTTP method
branch topic
branch topic