1)首先要下载nginx包这里以1.12.2为例;
2)安装nginx所需的支持包
yum install -y gcc gcc-c++ pcre-devel zlib-devel
3)创建nginx用户
useradd -M -s /sbin/nologin nginx
4)解压nginx并配置
tar zxf nginx-1.12.2.tar.gz
①vi src/core/nginx.h 13行
#define nginx_version 1010002
#define NGINX_VERSION "6.12.62" #此行修改的是你想要的版本号
#define NGINX_VER "MidServer/" NGINX_VERSION
#此行修改的是你想修改的软件名称
![](https://s1.51cto.com/images/blog/201901/08/dcb7f60989243494cb5e2351d441433f.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
②# vim src/http/ngx_http_special_response.c 29行
#static u_char ngx_http_error_tail[] =
"
MidServer " CRLF
"