In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
After setting up the nginx, we will generally hide the version number of the nginx to prevent others from knowing your version number and take advantage of the vulnerability of this version to gongji your system. This will make your nginx system more secure.
Nginx displays the version number by default, such as:
D:\ curl-7.66.0-win32-mingw\ bin > curl- I a.jinxing.com
HTTP/1.1 200 OK
Server: nginx/1.6.3
Date: Wed, 23 Oct 2019 02:30:24 GMT
Content-Type: text/html
Content-Length: 22
Last-Modified: Wed, 18 Sep 2019 06:56:09 GMT
Connection: keep-alive
ETag: "5d81d509-16"
Accept-Ranges: bytes
Hidden version number method:
1. Edit the nginx configuration file
Add server_tokens off to http {-}
2. Edit the php-fpm configuration file, such as fastcgi.conf or fcgi.conf (this configuration file name can also be customized and modified according to the specific file name):
Find:
Fastcgi_param SERVER_SOFTWARE nginx/$nginx_version
Change to:
Fastcgi_param SERVER_SOFTWARE nginx
3. Reload the nginx configuration:
In this way, the nginx version number is completely hidden, and the nginx version will not be displayed even if there are 404,501 pages.
Let's test it.
D:\ curl-7.66.0-win32-mingw\ bin > curl- I a.jinxing.com
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 23 Oct 2019 02:41:09 GMT
Content-Type: text/html
Content-Length: 22
Last-Modified: Wed, 18 Sep 2019 06:56:09 GMT
Connection: keep-alive
ETag: "5d81d509-16"
Accept-Ranges: bytes
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.