1、备份nginx配置文件

[root@bogon worktile]# cp conf/nginx/global.conf{,_20200620bak}

2、修改配置文件

[root@bogon worktile]# vi conf/nginx/global.conf 
user root;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

daemon off;
events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'$upstream_addr '
'request_time: $request_time '
'upstream_connect_time: $upstream_connect_time ' # added in 1.9.1
'upstream_header_time: $upstream_header_time ' # added in 1.7.10
'ups_resp_time: $upstream_response_time';

access_log /root/data/logs/access.log main;
error_log /root/data/logs/error.log error;

sendfile on;
#tcp_nopush on;

server_tokens off; # 隐藏nginx版本号

keepalive_timeout 1800;

client_max_body_size 2048m;

3、重启Nginx服务

[root@bogon worktile]# wt-restart-nginx

4、本地测试

[root@bogon worktile]# curl -I localhost
HTTP/1.1 200 OK
Server: nginx # 版本信息被隐藏
Date: Mon, 22 Jun 2020 16:53:28 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2536
Connection: keep-alive
Vary: Accept-Encoding
X-Frame-Options: SAMEORIGIN