![e97c5b3f6e3b1d268f57e96bb66b4bc6.png](https://img-blog.csdnimg.cn/img_convert/e97c5b3f6e3b1d268f57e96bb66b4bc6.png)
安全优化-隐藏版本号server_tokens
Syntax: server_tokens on | off | build | string;
Default: server_tokens on;
Context: http, server, location
在主配置文件nginx.conf、虚拟主机的配置文件中配置,选一个配置即可
官方文档地址:http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens
在主配置文件nginx.conf加入
[root@web01 conf]# cat /application/nginx/conf/nginx.confworker_processes 2;error_log logs/error.log; #配置Nginx worker进程最大打开文件数worker_rlimit_nofile 65535; user www www;events { #单个进程允许的客户端最大连接数 worker_connections 20480;}http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #访问日志配置 log_format ma