Nginx NginxMainModule configuration and parameter meanings

Source: Internet
Author: User
Nginx NginxMainModule (main module) configuration and each parameter meaning here is the command to control the basic functions of Nginx. command: [html] [# daemondaemon] [# debug_pointsdebug_points] [# error_logerror_log] [# includeinclude]...
The nginx Main Module configuration and parameter definitions in Nginx are the commands used to control the basic functions of Nginx. command: [html] [# daemon] [# debug_points] [# error_log] [# include] [# lock_file] [# master_process]
[# Pid] [# ssl_engine] [# timer_resolution] [# user group] [# worker nodes] [# worker_priority nodes] [# worker_processes] [# worker nodes] [# worker_rlimit_nofile] [# worker_rlimit_sigpending] [# working_directory] www.2cto.com dae Mon syntax: daemon | off default value: on [html] daemon off; Do not use the "daemon" and "master_process" directives in a production mode, these options are mainly used for development only. you can use daemon off safely in production mode with runit/daemontools however you can't do a graceful upgrade. master_process off shocould never be used in production. do not use the "daemon" and "master_process" commands in the production environment. these options are only used for development and debugging. Debug_points syntax: debug_points [stop | abort] default value: none [html] debug_points stop; There are some assertion points inside nginx that allow to stop nginx to attach the debugger, or to abort and to create the core file. it should be suitable for debugging, setting breakpoints in the debugger, and so on. Www.2cto.com error_log syntax: error_log file [debug | info | notice | warn | error | crit] default value: $ {prefix}/logs/error. logNginx adds the -- with-debug compilation parameter. you can also use the following configuration: [html] error_log LOGFILE [debug_core | debug_alloc | debug_mutex | debug_event]: | debug_http | debug_imap; include syntax: include file | * Default value: none you can use the include command to include the configuration file anywhere. similar to the include method in apache, this can reduce the main configuration file d. The www.2cto.com include command also supports global inclusion methods like the following configuration, for example, containing all ". conf "end File: [html] include vhosts /*. conf; note that the path is the configure compilation parameter -- prefix = <路径> If not specified, Nginx is compiled in/usr/local/nginx by default. Syntax: lock_file file default value: compile-time option [html] lock_file/var/log/lock_file; nginx uses accept mutex to serialize accept () syscils. if nginx is built by gcc, Intel C ++, or SunPro C ++ compilers on i386, amd64, sparc64, and ppc64, then nginx uses the atomic instructions to implement the mutex. in other cases the lock file wocould be used.www.2cto.com master_process syntax: master_process on | off default value: on [Html] master_process off; Do not use the "daemon" and "master_process" directives in a production mode, these options are mainly used for development only. do not use the "daemon" and "master_process" commands in the production environment. these options are only used for development and debugging. Pid syntax: pid file default value: compile-time option Example: [html] pid/var/log/nginx. pid; process id storage file. You can use kill-HUP cat/var/log/nginx. pid \ to reload the Nginx configuration file. Ssl_engine syntax: ssl_engine engine default value: system dependentHere you can set your preferred openssl engine if any available. you can figure out which one do you have with the commandline tool: this command is used to specify the engine used by openssl. You can obtain the currently supported openssl engine www.2cto.com openssl engine-t through the following command line: [html] $ openssl engine-t (cryptodev) BSD cryptodev engine: [available] (dynamic) Dynamic engine loading support: [unavailable] timer_resolution syntax: optional t default value: noneExample: [html] timer_resolution 100 ms; specify The directive allows to decrease number gettimeofday () syscils. by default gettimeofday () is called aft Er each return from kevent (), epoll,/dev/poll, select (), poll (). but if you need an exact time in logs when logging $ upstream_response_time, or $ msec variables, then you shocould use timer_resolution.user syntax: user [group] default value: nobody specifies the Nginx Worker process running user. the default value is nobody account. For example: [html] user www users; worker_cpu_affinity syntax: worker_cpu_affinity cpumask [cpumask...] default value: noneLinux only. with this option you can bind the worker process to a CPU, it callsched_setaffinity (). this option is only applicable to linux. you can use this option to bind a worker process and CPU. for example, [html] worker_proceses 4; worker_cpu_affinity 0001 0010 0100; Bind each worker process to one CPU only. bind a CPU to each worker process. www.2cto.com [html] worker_pro Ceses 2; worker_cpu_affinity 0101 1010; Bind the first worker to CPU0/CPU2, bind the second worker to CPU1/CPU3. This is suitable for HTT. bind CPU0/CPU2 to the first worker process and bind CPU1/CPU3 to the second worker process. Worker_priority syntax: worker_priority [-] number default value: onWith this option you can give to all worker processes the priority (nice) you need/wish, it callsetpriority (). this option can be used to assign priority values to all worker processes. Worker_processes syntax: worker_processes number default value: 1e. g.: worker_processes 5; nginx has the ability to use more than one worker process for several reasons: nginx can use multiple worker processes for the following reasons: to use SMPto decrease latency when workers blockend on disk I/Oto limit number of connections per process when select ()/poll () is usedThe worker_processes and worker_connections from the event sections allows you to calculate maxclients value: kmax_clients = worker_processes * worker_connections limit syntax: required size default value: 'maximum size of core file per worker; www.2cto.com worker_rlimit_nofile syntax: worker_rlimit_nofile limit default value: 'specifies the value for maximum file descriptors that can be opened by this process. worker_rlimit_sigpending syntax: worker_rlimit_sigpending limit default value: '(Since Linux 2.6.8) Specifies the limit on the number of signals that may be queued for the real user ID of the calling process.
Working_directory syntax: working_directory path default value: -- prefixThis is the working directory for the workers. it's used for core files only. nginx uses absolute paths only, all relative paths in configuration files are relative to -- prefix = PATH.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.