# Curl -- headwww. nginx. netHTTP/1.1302 MovedTemporarilyServer: nginx/0.8.38Date: Fri, 04Jun201001: 08: 44GMTContent-Type: text/htmlContent-Length: 161 Connection: keep-alive
# Curl -- head www.nginx.net
HTTP/1.1 302 Moved Temporarily
Server: nginx/0.8.38
Date: Fri, 04 Jun 2010 01:08:44 GMT
Content-Type: text/html
Content-Length: 161
Connection: keep-alive
Keep-Alive: timeout = 15
Location: http://nginx.org/
In this way, you can see that your nginx version is 0.8.38.
Can it be left blank?
Of course.
# Vi nginx. conf
Add server_tokens off in http;
Http {
...... Omitted configuration
Sendfile on;
Tcp_nopush on;
Keepalive_timeout 65;
Tcp_nodelay on;
Server_tokens off;
....... Omitted configuration
}
Edit the php-fpm configuration file, such as fcgi. conf and fastcgi. conf (depending on the configuration file name)
Fastcgi_param SERVER_SOFTWARE nginx/$ nginx_version;
Change
Fastcgi_param SERVER_SOFTWARE nginx;
The nginx reload configuration is complete. The nginx version will not be displayed on pages such as 404 and 501.
# Curl -- head 127.0.0.1
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 13 Jan 2010 06:25:01 GMT
Content-Type: text/html
Content-Length: 793
Last-Modified: Sat, 12 Dec 2009 02:28:16 GMT
Connection: keep-alive
Accept-Ranges: bytes
Check the configuration file again:
/Usr/local/nginx/sbin/nginx-t
If the following two lines of information are displayed, the configuration file is correct:
The configuration file/usr/local/webserver/nginx/conf/nginx. conf syntax is OK
The configuration file/usr/local/webserver/nginx/conf/nginx. conf was tested successfully
Smooth restart:
For Nginx 0.8.x, it is very easy to smoothly restart Nginx. run the following command:
/Usr/local/nginx/sbin/nginx-s reload