赞
踩
(1)下载最新稳定版nginx包
官网下载地址:https://nginx.org/en/download.html
(2)将nginx包拷贝到服务器并解压(# 解压到当前目录下tar -zxvf 资源包)
(3)备份服务器nginx.conf文件、ssl证书文件
#define NGINX_VERSION ""
#define NGINX_VER "CSDN" NGINX_VERSION
static u_char ngx_http_server_string[] = "Server: CSDN" CRLF;
static u_char ngx_http_error_tail[] =
"<hr><center>CSDN</center>" CRLF
"</body>" CRLF
"</html>" CRLF
(1)进入安装包目录:/home/nginx1.16.1
(2)./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
(3)make && make install
cd /usr/local/nginx/sbin/
./nginx #启动
./nginx -s stop #停止
./nginx -s quit #退出
./nginx -s reload #重启 修改配置后重新加载生效
./nginx -s reopen :重新打开日志文件
HTTP/1.1 200
Server: CSDN
Date: Wed, 03 Jul 2024 09:40:49 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。