$ sudo apt install -y nginx
$ systemctl status nginx $ sudo ss -plntu | grep nginx
$ sudo systemctl start nginx
$ sudo systemctl stop nginx
$ sudo systemctl restart nginx
# /usr/sbin/nginx -s stop
# systemctl status nginx
$ sudo nginx -t && sudo nginx -s reload
auto/configure is used in place of the traditional ./configure to configure the options with which nginx will be compiled. auto/configure can be queried by calling nginx with the -V command line option. auto/options contains a list of shell variables which correspond to configurable options. HTTP_SSL=NO or HTTP_REWRITE=YES. auto/configure and replaces the default values with the ones specified when auto/configure is called, for example like so: ./auto/configure \ --without-http_rewrite_module \ --with-http_ssl_module
$opt and then assigned to NGX_CONFIGURE. #define NGX_CONFIGURE into the file whose value is stored in $NGX_AUTO_CONFIG_H (typically objs/ngx_auto_config.h) and can be displayed with the command line option -V: $ objs/nginx -V 2>&1 | grep 'configure arguments' … configure arguments: --without-http_rewrite_module --with-http_ssl_module
auto/init is the second script that is called from auto/configure. $NGX_OBJS: Makefile (but compare with this line)
ngx_modules.c
ngx_auto_headers.h
ngx_auto_config.h
ngx_autotest.h
ngx_autoconf.err (but compare with this line) auto/init also sets the variable NGX_AUTOTEST to $NGX_OBJS/autotest. auto/feature but also in other tests such as auto/types/uintptr_t etc. auto/cc/conf specifies options (etc.?) with which the compiler is invoked. auto/cc/conf sources auto/cc/name which, depending on the compiler this script finds, sets the variable NGX_CC_NAME, for example to the value gcc in the case of the GNU compiler. NGX_CC_NAME, the script then sources auto/cc/gcc, auto/cc/icc, auto/cc/msvc etc. auto/cc/conf is called from auto/configure. auto/cc/<compiler> (such as for example auto/cc/gcc) seem to basically set variables like CFLAGS. auto/have adds a «have» directive to $NGX_AUTO_CONFIG_H (typically objs/ngx_auto_config.h). have=NGX_HAVE_EPOLL . auto/have
$NGX_AUTO_CONFIG_H: #ifndef NGX_HAVE_EPOLL #define NGX_HAVE_EPOLL 1 #endif
src/core/ngx_array.h. elts is a pointer to the elements of the array. nelts stores the number of the elements in the array. obj/ngx_modules.c is a generated file. auto/init sets the variable $NGX_MODULES_C to obj/ngx_modules.c. auto/make sets the variable ngx_modules_c from $NGX_MODULES_C (by replacing / with either a forward or backward slash, depending on the environment). $ngx_module_modules array and writes into obj/ngx_modules.c. ngx_modules of pointers to ngx_module_t, such as ngx_module_t *ngx_modules[] = {
&ngx_core_module,
&ngx_errlog_module,
&ngx_conf_module,
&ngx_openssl_module,
…
NULL
};
src/core/ngx_module.c iterates over the elements in ngx_modules and sets each module's index and name. ngx_cycle_modules() creates a list of modules. DYNAMIC_MODULES … auto/modules sets a few variables an then calls auto/module. auto/module is only called from auto/modules. auto/module expects the following variables to be set (possibly to an empty value): $ngx_module_type | CORE, HTTP, HTTP_FILTER, HTTP_INIT_FILTER, MAIL, STREAM, MISC |
$ngx_module_name | |
$ngx_module_incs | The name of a directory. |
$ngx_module_deps | |
$ngx_module_srcs | The (relative) path to a .c file. |
$ngx_module_libs | |
$ngx_module_link |
auto/feature checks if the compiler supports a given feature. ngx_feature | |
ngx_feature_name | An identifier such as NGX_HAVE_EPOLL, NGX_HAVE_GEOIP_V6 or NGX_PCRE. |
ngx_feature_run | yes, bug, value have a specific meaning. no is indicated as absence (but any other value can be chosen) |
ngx_feature_incs | Additional includes required for the test. |
ngx_feature_path | |
ngx_feature_libs | |
ngx_feature_test |
$NGX_AUTOTEST.c) with the following content, compiles and executes it: #include <sys/types.h>
$NGX_INCLUDE_UNISTD_H
$ngx_feature_incs
int main(void) {
$ngx_feature_test;
return 0;
}
$NGX_AUTO_CONFIG_H using auto/have (ngx_feature_run != value (especially yes or value)) or directly (ngx_feature_run = value). $NGX_AUTOCONF_ERR auto/feature is sourced from auto/unix
auto/cc/conf
auto/cc/gcc
auto/cc/name
auto/lib/google-perftools/conf
auto/lib/zlib/conf
auto/lib/pcre/conf
auto/lib/openssl/conf
auto/lib/libatomic/conf
auto/lib/geoip/conf
auto/lib/libgd/conf
auto/lib/libxslt/conf
auto/os/linux
auto/os/darwin
auto/os/solaris main() function is defined in src/core/nginx.c. main() calls ngx_get_options() which parses the command line options
ngx_ssl_init() struct ngx_command_s defines a configuration directive and associates a configuration name with a call back function (such as for example ngx_set_worker_processes) that processes the configuration directive when encountered ngx_core_commands is an array of ngx_command_t objects. ngx_core_commands, there is also the variable ngx_http_core_commands which takes care of configuration options such as listen. set of the ngx_command_s struct. listen, this callback function is ngx_http_core_listen which is called «indirectly» from here. struct ngx_conf_s (typedefd to ngx_conf_t) … ngx_get_options() parses command line options. main -> ngx_init_cycle -> ngx_conf_parse -> ngx_conf_handler ngx_command_s is typedefd to ngx_command_t. name
type
set ngx_get_options() is called from main() and parses command line options, such as for example -p <prefix-dir>. ngx_conf_parse (src/core/ngx_conf_file.c) is called from different places, such as main() -> ngx_init_cycle() -> ngx_conf_param()(here, where no filename is passed).
main() -> ngx_init_cycle() -> (here, where a filename is passed).
main() -> ngx_init_cycle() -> ngx_conf_parse() -> ngx_conf_handler() -> ngx_events_block()
main() -> ngx_init_cycle() -> ngx_conf_parse() -> ngx_conf_handler() -> ngx_http_block() ngx_conf_read_token() returns one of NGX_OK | A config option, such as listen 8080; or worker_processes auto; |
NGX_CONF_BLOCK_START | The token is the name of a «named block», for example http { or server { |
NGX_CONF_BLOCK_DONE | The terminating } of a «named block» |
NGX_CONF_FILE_DONE | The end |
NGX_ERROR |
struct ngx_str_s has the two members len and
data struct ngx_buf_s is used for I/O operations. ngx_chain_s seems to represent a node in a linked list of ngx_buf_s elements. ngx_epoll_process_events calls ngx_event_accept. ngx_event_accept calls ngx_http_init_connection. ngx_http_init_connection is assigned to ls->handler in ngx_http_add_listening (ls being an instance of ngx_listening_t returned by ngx_http_add_listening). struct ngx_cycle_s … and the typedef connections: an array of connection_n ngx_connection_s objects (corresponding to the worker_connections directive).
free_connections: the free_connection_n ngx_connection_s objects that are available.
listening: an array of ngx_listening_s objects conf_ctx is a pointer to a pointer to a pointer to a pointer to void. struct ngx_pool_s used for memory allocation. src/http/ngx_http_core_module.h. src/core/ngx_connection.c (function ngx_open_listening_sockets),
src/event/ngx_event_connect.c (function ngx_event_connect_peer),
src/event/ngx_event_acceptex.c (function ngx_event_post_acceptex),
src/core/ngx_resolver.c (ngx_udp_connect and ngx_tcp_connect)
src/core/ngx_syslog.c (ngx_syslog_init_peer) typedef for a function pointer taking an ngx_http_request_t and an ngx_chain_t and returning an ngx_int_t. ngx_http_top_body_filter is a variable whose type is ngx_http_output_body_filter_pt ngx_http_write_filter_module assigns ngx_http_write_filter to ngx_http_top_body_filter. ngx_http_top_header_filter. ngx_http_write_filter_module writes data to the client socket. ngx_http_output_filter() essentially calls ngx_http_top_body_filter(). ngx_http_init_connection is the function that seems to be called when a new HTTP request was accepted. NGX_HTTP_POST_READ_PHASE through NGX_HTTP_CONTENT_PHASE struct ngx_listening_s and typedef struct ngx_listening_s ngx_listening_t in src/core/ngx_connection.h. ngx_socket_t fd
ngx_connection_handler_pt handler (The handler of accepted connections).
connection (a pointer to an ngx_connection_s which has the member listening which points to an ngx_listening_s). handler is set to ngx_http_init_connection in ngx_http_add_listening struct ngx_connection_s in src/core/ngx_connection.h and the corresponding typedef struct ngx_connection_s ngx_connection_t; in src/core/ngx_core.h. data (TODO: see here)
fd (which is an ngx_socket_t)
read and write (which are ngx_event_t)
recv and send
ssl (compare with ssl in ngx_http_connection_t).
listening (an ngx_listening_s which has the member connection which points to a ngx_connection_s)
send_chain and recv_chain (whose type is ngx_send_chain_pt and ngx_recv_chain_pt). It seems that these function pointers point to functions (like ngx_send_chain or ngx_ssl_send_chain?) that actually read or write data from a socket. ngx_connection_handler_pt takes an ngx_connection_t as argument. session_ctx, a pointer to SSL_CTX, compare with the member ctx of ngx_ssl_s.
handler, a ngx_connection_handler_pt
session, a pointer to a ngx_ssl_session_s ngx_ssl_write() is the function that calls SSL_write(). ssl_servername
keepalive_timeout
ssl (which is a flag). Compare with the member ssl in ngx_connection_s struct ngx_module_s and the corresponding typedef struct ngx_module_s ngx_module_t. ngx_module_s. ngx_count_modules() typedef struct { … } ngx_event_module_t. (Note: there is no named struct ngx_event_module_s). actions which is an ngx_event_actions_t. ngx_int_t (*add )(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags); ngx_int_t (*del )(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags); ngx_int_t (*enable )(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags); ngx_int_t (*disable )(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags); ngx_int_t (*add_conn )(ngx_connection_t *c); ngx_int_t (*del_conn )(ngx_connection_t *c, ngx_uint_t flags); ngx_int_t (*notify )(ngx_event_handler_pt handler); ngx_int_t (*process_events)(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags); ngx_int_t (*init )(ngx_cycle_t *cycle, ngx_msec_t timer); void (*done )(ngx_cycle_t *cycle);
ngx_connection_handler_pt is found as handler in ngx_listening_s (which handles accepted connections).
handler in ngx_ssl_connection_s
save_session in ngx_ssl_connection_s ngx_create_listening returns an ngx_listening_t * object. src/core/ngx_connection.c. main -> ngx_init_cycle -> ngx_conf_parse -> ngx_conf_handler -> ngx_http_block -> ngx_http_optimize_servers -> ngx_http_init_listening -> ngx_http_add_listening -> ngx_create_listening ngx_ssl_create_connection is the function that SSL_new, SSL_set_fd etc
ngx_ssl_connection_t object and assigns the value returned by SSL_new to its connection member ngx_http_create_request returns a pointer to a ngx_http_request_t. ngx_http_create_request returns a pointer to ngx_http_request_t (as does also ngx_http_create_request). r->http_connection is set to c->data (via the temporary variable hc).
r->read_event_handler is set to ngx_http_block_reading connection (a pointer to a ngx_connection_t)
read_event_handler and write_event_handler (which are ngx_http_event_handler_pt)
http_connection (which is a ngx_http_connection_t)
request_line
headers_in (which is a ngx_http_headers_in_t)
headers_out (which is a ngx_http_header_out_t)
content_handler (a ngx_http_handler_pt) ngx_http_request_t is returned by ngx_http_create_request. servers
phases, an array of ngx_http_phase_t
phase_engine ngx_http_phase_t which is essentially an array of handlers. ngx_http_phases is an enum with the following items: NGX_HTTP_POST_READ_PHASE | |
NGX_HTTP_SERVER_REWRITE_PHASE | |
NGX_HTTP_FIND_CONFIG_PHASE | |
NGX_HTTP_POST_REWRITE_PHASE | |
NGX_HTTP_PREACCESS_PHASE | |
NGX_HTTP_ACCESS_PHASE | |
NGX_HTTP_POST_ACCESS_PHASE | |
NGX_HTTP_PRECONTENT_PHASE | |
NGX_HTTP_CONTENT_PHASE | This is the (imho) interesting phase where the response is generated. |
NGX_HTTP_LOG_PHASE |
NGX_HTTP_POST_READ_PHASE through NGX_HTTP_CONTENT_PHASE are run by ngx_http_core_run_phases(). ngx_http_init_phase_handlers iterates over each «handler type» and seems to initialize a «checker» function. NGX_HTTP_CONTENT_PHASE is ngx_http_static_module which is initialized in ngx_http_static_init. ngx_http_static_handler. ngx_os_io_t seems to be a platform dependent struct to store function pointers for sending and receiving functions (src/os/unix/ngx_os.h and src/os/win32/ngx_os.h). src/core/ngx_connection.c defines the variable ngx_io of type ngx_os_io_t. ngx_linux_io (whose type is ngx_os_io_t). src/event/ngx_event.h defines macros such as ngx_recv for ngx_io.recv etc. struct ngx_event_s in src/event/ngx_event.h and the corresponding typedef struct ngx_event_s ngx_event_t in src/core/ngx_core.h. ngx_event_handler_pt takes an ngx_event_t as argument. data can be set to ngx_connection_t
ngx_event_handler_pt
ngx_cycle_t
ngx_resolver_t
ngx_open_file_cache_event_t
ngx_resolver_ctx_t struct ngx_rbtree_s has the members root (a ngx_rbtree_node_t)
sentinel (a ngx_rbtree_node_t)
insert (a ngx_rbtree_insert_pt) ngx_event_timer_rbtree ngx_event_handler_pt is found, among others, in struct ngx_event_s (member handler)
struct ngx_event_handler_pt (members saved_read_handler and saved_write_handler).
notify function pointer in ngx_event_actions_t worker_process (whose value can be set to auto). ngx_master_process_cycle is the master process. epoll_create() is successfull and depending on the result to set the event module. ngx_epoll_init. ep. ngx_process_events is a macro that is defined as ngx_event_actions.process_events. ngx_process_events_and_timers. ngx_epoll_process_events(). ngx_epoll_process_events() is the function that calls epoll_wait. ngx_epoll_process_events has the parameter timer which corresponds to the next timer event as found in the ngx_event_timer_rbtree and is passed to epoll_wait. ngx_event_timer_init()
NGX_EVENT_MODULE.
sigaction(SIGALARM…) and settimer() ngx_event_timer_init() initializes the ngx_event_timer_rbtree. ngx_process_events_and_timers is the nginx event loop. ngx_process_events_and_timers include ngx_event_find_timer() (if ngx_timer_resolution is false)
ngx_process_events()
ngx_event_expire_timers() ngx_event_find_timer() finds the «next» point in time stored in ngx_event_timer_rbtree and returns the time left until that timer expires, or NGX_TIMER_INFINITE if no timer event is outstanding. return (timer > 0 ? timer : 0)). epoll_wait (if epoll is used), see ngx_epoll_process_events(). --with-cc= | PATH | CC | ${CC:-cc} | set C compiler pathname | |
--with-cpp= | PATH | CPP | set C preprocessor pathname | ||
--with-cpu-opt= | CPU | CPU | NO | build for the specified CPU, valid values: pentium, pentiumpro, pentium3, pentium4, athlon, opteron, sparc32, sparc64, ppc64 | |
--add-dynamic-module= | PATH | DYNAMIC_ADDONS | enable dynamic external module | ||
| DYNAMIC_MODULES | |||||
| DYNAMIC_MODULES_SRCS | |||||
| EVENT_FOUND | NO | ||||
--with-poll_module | EVENT_POLL | NO | enable poll module | ||
--without-poll_module | EVENT_POLL | NO | disable poll module | ||
--with-select_module | EVENT_SELECT | NO | enable select module | ||
--without-select_module | EVENT_SELECT | NO | disable select module | ||
--without-http | HTTP | YES | disable HTTP server | It seems to me that this option is intended to be used if nginx is used as proxy (reverse proxy, mail proxy or tcp/udp proxy) or as load balancer. | |
--without-http_access_module | HTTP_ACCESS | YES | disable ngx_http_access_module | ||
--with-http_addition_module | HTTP_ADDITION | NO | enable ngx_http_addition_module | ||
--without-http_auth_basic_module | HTTP_AUTH_BASIC | YES | disable ngx_http_auth_basic_module | ||
--with-http_auth_request_module | HTTP_AUTH_REQUEST | NO | enable ngx_http_auth_request_module | ||
--without-http_autoindex_module | HTTP_AUTOINDEX | YES | disable ngx_http_autoindex_module | ||
--without-http_browser_module | HTTP_BROWSER | YES | disable ngx_http_browser_module | ||
--without-http-cache | HTTP_CACHE | YES | disable HTTP cache | ||
--without-http_charset_module | HTTP_CHARSET | YES | disable ngx_http_charset_module | ||
--with-http_dav_module | HTTP_DAV | NO | enable ngx_http_dav_module | ||
--with-http_degradation_module | HTTP_DEGRADATION | NO | enable ngx_http_degradation_module | ||
--without-http_empty_gif_module | HTTP_EMPTY_GIF | YES | disable ngx_http_empty_gif_module | ||
--without-http_fastcgi_module | HTTP_FASTCGI | YES | disable ngx_http_fastcgi_module | ||
--with-http_flv_module | HTTP_FLV | NO | enable ngx_http_flv_module | ||
--without-http_geo_module | HTTP_GEO | YES | disable ngx_http_geo_module | ||
--with-http_geoip_module | HTTP_GEOIP | NO | enable ngx_http_geoip_module | ||
--with-http_geoip_module= | dynamic | HTTP_GEOIP | NO | enable dynamic ngx_http_geoip_module | |
--without-http_grpc_module | HTTP_GRPC | YES | disable ngx_http_grpc_module | ||
--with-http_gunzip_module | HTTP_GUNZIP | NO | enable ngx_http_gunzip_module | ||
--without-http_gzip_module | HTTP_GZIP | YES | disable ngx_http_gzip_module | ||
--with-http_gzip_static_module | HTTP_GZIP_STATIC | NO | enable ngx_http_gzip_static_module | ||
--with-http_image_filter_module | HTTP_IMAGE_FILTER | NO | enable ngx_http_image_filter_module | ||
--with-http_image_filter_module= | dynamic | HTTP_IMAGE_FILTER | NO | enable dynamic ngx_http_image_filter_module | |
--without-http_limit_conn_module | HTTP_LIMIT_CONN | YES | disable ngx_http_limit_conn_module | ||
--without-http_limit_req_module | HTTP_LIMIT_REQ | YES | disable ngx_http_limit_req_module | ||
--without-http_map_module | HTTP_MAP | YES | disable ngx_http_map_module | ||
--without-http_memcached_module | HTTP_MEMCACHED | YES | disable ngx_http_memcached_module | ||
--without-http_mirror_module | HTTP_MIRROR | YES | disable ngx_http_mirror_module | ||
--with-http_mp4_module | HTTP_MP4 | NO | enable ngx_http_mp4_module | ||
--with-http_perl_module | HTTP_PERL | NO | enable ngx_http_perl_module | ||
--with-http_perl_module= | dynamic | HTTP_PERL | NO | enable dynamic ngx_http_perl_module | |
--without-http_proxy_module | HTTP_PROXY | YES | disable ngx_http_proxy_module | ||
--with-http_random_index_module | HTTP_RANDOM_INDEX | NO | enable ngx_http_random_index_module | ||
--with-http_realip_module | HTTP_REALIP | NO | enable ngx_http_realip_module | ||
--without-http_referer_module | HTTP_REFERER | YES | disable ngx_http_referer_module | ||
--without-http_rewrite_module | HTTP_REWRITE | YES | disable ngx_http_rewrite_module | The ngx_http_rewrite_module depends on the PCRE library. Thus, this flag might be used if PCRE is not available. | |
--without-http_scgi_module | HTTP_SCGI | YES | disable ngx_http_scgi_module | ||
--with-http_secure_link_module | HTTP_SECURE_LINK | NO | enable ngx_http_secure_link_module | ||
--with-http_slice_module | HTTP_SLICE | NO | enable ngx_http_slice_module | ||
--without-http_split_clients_module | HTTP_SPLIT_CLIENTS | YES | disable ngx_http_split_clients_module | ||
--without-http_ssi_module | HTTP_SSI | YES | disable ngx_http_ssi_module | ||
--with-http_ssl_module | HTTP_SSL | NO | enable ngx_http_ssl_module | ||
--without-http_status_module | HTTP_STATUS | ||||
--with-http_stub_status_module | HTTP_STUB_STATUS | NO | enable ngx_http_stub_status_module | ||
--with-http_sub_module | HTTP_SUB | NO | enable ngx_http_sub_module | ||
--without-http_upstream_hash_module | HTTP_UPSTREAM_HASH | YES | disable ngx_http_upstream_hash_module | ||
--without-http_upstream_ip_hash_module | HTTP_UPSTREAM_IP_HASH | YES | disable ngx_http_upstream_ip_hash_module | ||
--without-http_upstream_keepalive_module | HTTP_UPSTREAM_KEEPALIVE | YES | disable ngx_http_upstream_keepalive_module | ||
--without-http_upstream_least_conn_module | HTTP_UPSTREAM_LEAST_CONN | YES | disable ngx_http_upstream_least_conn_module | ||
--without-http_upstream_random_module | HTTP_UPSTREAM_RANDOM | YES | disable ngx_http_upstream_random_module | ||
--without-http_upstream_zone_module | HTTP_UPSTREAM_ZONE | YES | disable ngx_http_upstream_zone_module | ||
--without-http_userid_module | HTTP_USERID | YES | disable ngx_http_userid_module | ||
--without-http_uwsgi_module | HTTP_UWSGI | YES | disable ngx_http_uwsgi_module | ||
--with-http_v2_module | HTTP_V2 | NO | enable ngx_http_v2_module | ||
--with-http_v3_module | HTTP_V3 | NO | enable ngx_http_v3_module | ||
--with-http_xslt_module | HTTP_XSLT | NO | enable ngx_http_xslt_module | ||
--with-http_xslt_module= | dynamic | HTTP_XSLT | NO | enable dynamic ngx_http_xslt_module | |
--with-mail | NO | enable POP3/IMAP4/SMTP proxy module | |||
--with-mail= | dynamic | NO | enable dynamic POP3/IMAP4/SMTP proxy module | ||
--with-imap | Deprecated in favor of --with-mail | ||||
--without-mail_imap_module | MAIL_IMAP | YES | disable ngx_mail_imap_module | ||
--without-mail_pop3_module | MAIL_POP3 | YES | disable ngx_mail_pop3_module | ||
--without-mail_smtp_module | MAIL_SMTP | YES | disable ngx_mail_smtp_module | ||
--with-mail_ssl_module | MAIL_SSL | NO | enable ngx_mail_ssl_module | ||
--with-imap_ssl_module | MAIL_SSL | Deprecated in favor of --with-mail_ssl_module | |||
--add-module= | PATH | NGX_ADDONS | enable external module | ||
| NGX_ADDON_DEPS | |||||
| NGX_ADDON_SRCS | |||||
--build= | NAME | NGX_BUILD | set build name | ||
--with-cc-opt= | OPTIONS | NGX_CC_OPT | set additional C compiler options | ||
--with-compat | NGX_COMPAT | NO | dynamic modules compatibility | ||
--conf-path= | PATH | NGX_CONF_PATH | conf/nginx.conf | set nginx.conf pathname | |
| NGX_CONF_PREFIX | |||||
--with-cpp_test_module | NGX_CPP_TEST | NO | enable ngx_cpp_test_module | ||
| NGX_CPU_CACHE_LINE | |||||
--with-debug | NGX_DEBUG | NO | enable debug logging | ||
--error-log-path= | PATH | NGX_ERROR_LOG_PATH | set error log pathname | ||
--with-file-aio | NGX_FILE_AIO | NO | enable file AIO support | ||
--with-google_perftools_module | NGX_GOOGLE_PERFTOOLS | NO | enable ngx_google_perftools_module | ||
--group= | GROUP | NGX_GROUP | set non-privileged group for worker processes | ||
--http-client-body-temp-path= | PATH | NGX_HTTP_CLIENT_TEMP_PATH | set path to store http client request body temporary files | ||
--http-fastcgi-temp-path= | PATH | NGX_HTTP_FASTCGI_TEMP_PATH | set path to store http fastcgi temporary files | ||
--http-log-path= | PATH | NGX_HTTP_LOG_PATH | set http access log pathname | ||
--http-proxy-temp-path= | PATH | NGX_HTTP_PROXY_TEMP_PATH | set path to store http proxy temporary files | ||
--http-scgi-temp-path= | PATH | NGX_HTTP_SCGI_TEMP_PATH | set path to store http scgi temporary files | ||
--http-uwsgi-temp-path= | PATH | NGX_HTTP_UWSGI_TEMP_PATH | set path to store http uwsgi temporary files | ||
--with-ld-opt= | OPTIONS | NGX_LD_OPT | set additional linker options | ||
--with-libatomic | NGX_LIBATOMIC | NO | force libatomic_ops library usage | ||
--with-libatomic= | DIR | NGX_LIBATOMIC | NO | set path to libatomic_ops library sources | |
--lock-path= | PATH | NGX_LOCK_PATH | set nginx.lock pathname | ||
--modules-path= | PATH | NGX_MODULES_PATH | set modules path | ||
--builddir= | DIR | NGX_OBJS | objs | set build directory | |
--with-perl= | PATH | NGX_PERL | perl | set perl binary pathname | |
--with-perl_modules_path= | PATH | NGX_PERL_MODULES | set Perl modules path | ||
--pid-path= | PATH | NGX_PID_PATH | set nginx.pid pathname | ||
--crossbuild= | NGX_PLATFORM | ||||
| NGX_POST_CONF_MSG | |||||
--prefix= | PATH | NGX_PREFIX | /usr/local/nginx/ | set installation prefix | |
| NGX_RPATH | NO | ||||
--sbin-path= | PATH | NGX_SBIN_PATH | set nginx binary pathname | ||
--test-build-devpoll | NGX_TEST_BUILD_DEVPOLL | ||||
--test-build-epoll | NGX_TEST_BUILD_EPOLL | ||||
--test-build-eventport | NGX_TEST_BUILD_EVENTPORT | ||||
--test-build-solaris-sendfilev | NGX_TEST_BUILD_SOLARIS_SENDFILEV | ||||
--user= | USER | NGX_USER | set non-privileged user for worker processes | ||
| NGX_WINE | |||||
--with-openssl= | DIR | OPENSSL | NONE | set path to OpenSSL library sources | |
--with-openssl-opt= | OPTIONS | OPENSSL_OPT | set additional build options for OpenSSL | ||
--with-pcre= | DIR | PCRE | NONE | set path to PCRE library sources | |
--without-pcre2 | PCRE2 | YES | do not use PCRE2 library | ||
| PCRE_CONF_OPT | |||||
--with-pcre-jit | PCRE_JIT | NO | build PCRE with JIT compilation support | ||
--with-pcre-opt= | OPTIONS | PCRE_OPT | set additional build options for PCRE | ||
--without-quic_bpf_module | QUIC_BPF | NO | disable ngx_quic_bpf_module | ||
| SO_COOKIE_FOUND | NO | ||||
--with-stream | STREAM | NO | enable TCP/UDP proxy module | ||
--with-stream= | dynamic | STREAM | NO | enable dynamic TCP/UDP proxy module | |
--without-stream_access_module | STREAM_ACCESS | YES | disable ngx_stream_access_module | ||
--without-stream_geo_module | STREAM_GEO | YES | disable ngx_stream_geo_module | ||
--with-stream_geoip_module | STREAM_GEOIP | NO | enable ngx_stream_geoip_module | ||
--with-stream_geoip_module= | dynamic | STREAM_GEOIP | NO | enable dynamic ngx_stream_geoip_module | |
--without-stream_limit_conn_module | STREAM_LIMIT_CONN | YES | disable ngx_stream_limit_conn_module | ||
--without-stream_map_module | STREAM_MAP | YES | disable ngx_stream_map_module | ||
--without-stream_pass_module | STREAM_PASS | YES | disable ngx_stream_pass_module | ||
--with-stream_realip_module | STREAM_REALIP | NO | enable ngx_stream_realip_module | ||
--without-stream_return_module | STREAM_RETURN | YES | disable ngx_stream_return_module | ||
--without-stream_set_module | STREAM_SET | YES | disable ngx_stream_set_module | ||
--without-stream_split_clients_module | STREAM_SPLIT_CLIENTS | YES | disable ngx_stream_split_clients_module | ||
--with-stream_ssl_module | STREAM_SSL | NO | enable ngx_stream_ssl_module | ||
--with-stream_ssl_preread_module | STREAM_SSL_PREREAD | NO | enable ngx_stream_ssl_preread_module | ||
--without-stream_upstream_hash_module | STREAM_UPSTREAM_HASH | YES | disable ngx_stream_upstream_hash_module | ||
--without-stream_upstream_least_conn_module | STREAM_UPSTREAM_LEAST_CONN | YES | disable ngx_stream_upstream_least_conn_module | ||
--without-stream_upstream_random_module | STREAM_UPSTREAM_RANDOM | YES | disable ngx_stream_upstream_random_module | ||
--without-stream_upstream_zone_module | STREAM_UPSTREAM_ZONE | YES | disable ngx_stream_upstream_zone_module | ||
| USE_GEOIP | NO | ||||
| USE_LIBGD | NO | ||||
| USE_LIBXSLT | NO | ||||
| USE_OPENSSL | NO | ||||
| USE_OPENSSL_QUIC | NO | ||||
--with-pcre | USE_PCRE | NO | force PCRE library usage | ||
--without-pcre | USE_PCRE | NO | disable PCRE library usage | ||
| USE_PERL | NO | ||||
--with-threads | USE_THREADS | NO | enable thread pool support | ||
| USE_ZLIB | NO | ||||
--with-zlib= | DIR | ZLIB | NONE | set path to zlib library sources | |
--with-zlib-asm= | CPU | ZLIB_ASM | NO | use zlib assembler sources optimized for the specified CPU, valid values: pentium, pentiumpro | |
--with-zlib-opt= | OPTIONS | ZLIB_OPT | set additional build options for zlib | ||
--help | help | print this message | |||
--with-ipv6 | Deprecated | ||||
--with-md5= | Deprecated | ||||
--with-md5-opt= | Deprecated | ||||
--with-md5-asm | Deprecated | ||||
--with-sha1= | Deprecated | ||||
--with-sha1-opt= | Deprecated | ||||
--with-sha1-asm | Deprecated |
core/nginx.h #defines the following macros | name | possible value |
nginx_version | 1027000 |
NGINX_VERSION | 1.27.0 |
NGINX_VER_BUILD | NGINX_VER or NGINX_VER " (" NGX_BUILD ")"` |
NGX_OLDPID_EXT | ".oldbin" |
sudo /usr/sbin/nginx -V 2>&1 | grep '^configure arguments' | sed 's/ --/\n--/g'
configure arguments: --with-cc-opt='-g -O2 -ffile-prefix-map=/build/nginx-AoTv4W/nginx-1.22.1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=stderr --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-compat --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-mail_ssl_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-stream_realip_module --with-http_geoip_module=dynamic --with-http_image_filter_module=dynamic --with-http_perl_module=dynamic --with-http_xslt_module=dynamic --with-mail=dynamic --with-stream=dynamic --with-stream_geoip_module=dynamic
$ apt show python3-certbot-nginx 2>/dev/null | grep Description Description: Nginx plugin for Certbot
auto/configure option --with-threads. See also the configure-time file auto/threads. --without-http? ./configure --with-http_image_filter_module=dynamic ./configure --add-dynamic-module=/path/to/module
nginx.conf load_module modules/ngx_http_image_filter_module.so;
/etc/nginx is the directory in which nginx is configured.