Nginx -V 输出到stderr

src/core/nginx.c

Nginx 获取版本和配置信息

src/core/ngx_log.h

Nginx 获取版本和配置信息

shell ps获取版本信息

#nginx -v 2>&1| awk -F":" '{print $2}' | tr -d " "
nginx/1.6.3

shell ps获取nginx版本和配置信息

nginx -V 2>&1 ##输出到stdout,然后使用管道获取相关信息

相关文章: