Tengine基础4

2022-04-25 00:17:11 浏览数 (1)

这些模块都很实用, ngx_http_upstream_check_module 可以检查后端服务器的状态

代码语言:javascript复制
[root@i-1avyrt2d nginx.old]# /usr/local/nginx/sbin/nginx  -m  2>&1  | grep upstream 
    ngx_http_upstream_module (static)
    ngx_http_upstream_ip_hash_module (static)
    ngx_http_upstream_consistent_hash_module (static)
    ngx_http_upstream_check_module (static)
    ngx_http_upstream_least_conn_module (static)
    ngx_http_upstream_keepalive_module (static)
    ngx_http_upstream_dynamic_module (static)
    ngx_http_upstream_session_sticky_module (static)
[root@i-1avyrt2d nginx.old]# /usr/local/nginx/sbin/nginx  -m  2>&1  | grep upstream | grep check 
    ngx_http_upstream_check_module (static)
[root@i-1avyrt2d nginx.old]# 

Tip: 官方版本的没有 -m 选项,不能方便的列出加载的模块

代码语言:javascript复制
[root@i-1avyrt2d nginx.old]# sbin/nginx -h 
nginx version: nginx/1.9.6
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/local/nginx/)
  -c filename   : set configuration file (default: conf/nginx.conf)
  -g directives : set global directives out of configuration file

[root@i-1avyrt2d nginx.old]# sbin/nginx -v
nginx version: nginx/1.9.6
[root@i-1avyrt2d nginx.old]# sbin/nginx -V
nginx version: nginx/1.9.6
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
configure arguments:
[root@i-1avyrt2d nginx.old]# 

从目录结构可以看到,多了不少东西, nginx.old 是官方版本

代码语言:javascript复制
[root@i-1avyrt2d nginx]# ll /usr/local/nginx
total 44
drwx------ 2 nginx root 4096 Nov  4 14:17 client_body_temp
drwxr-xr-x 3 root  root 4096 Nov  4 16:09 conf
drwx------ 2 nginx root 4096 Nov  4 14:17 fastcgi_temp
drwxr-xr-x 2 root  root 4096 Nov  4 14:15 html
drwxr-xr-x 2 root  root 4096 Nov  4 14:15 include
drwxr-xr-x 2 root  root 4096 Nov  4 16:10 logs
drwxr-xr-x 2 root  root 4096 Nov  4 14:15 modules
drwx------ 2 nginx root 4096 Nov  4 14:17 proxy_temp
drwxr-xr-x 2 root  root 4096 Nov  4 14:15 sbin
drwx------ 2 nginx root 4096 Nov  4 14:17 scgi_temp
drwx------ 2 nginx root 4096 Nov  4 14:17 uwsgi_temp
[root@i-1avyrt2d nginx]# ll /usr/local/nginx.old/
total 16
drwxr-xr-x 3 root root 4096 Nov  4 10:37 conf
drwxr-xr-x 2 root root 4096 Nov  4 10:22 html
drwxr-xr-x 2 root root 4096 Nov  4 13:09 logs
drwxr-xr-x 2 root root 4096 Nov  4 10:22 sbin
[root@i-1avyrt2d nginx]# 

0 人点赞