nginx 隐藏版本version

现在我旗下的网站基本全部都转移到nginx了,但是nginx 出现40X 和 50x 的错误的时候,经常会显示版本号,这让我很不爽

无意间看到某个nginx站点出问题的时候,竟然不显示版本号。 google 了一下,原来nginx 有个命令叫做server_tokens, 把它设置为off 即可


Syntax: server_tokens on | off | build | string;
server_tokens on;
Context: http, server, location

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.