gpt4 book ai didi

nginx - 是否可以更改不在 nginx.conf 中的 server_tokens 指令?

转载 作者:行者123 更新时间:2023-12-02 15:32:22 26 4
gpt4 key购买 nike

我需要取消注释 nginx.conf 中的以下行

#server_tokens off;

但我不想直接在 nginx.conf 中进行更改,所以是否可以在另一个地方进行此更改,比如在/etc/nginx/conf.d/目录中的某些配置文件中?

最佳答案

这可以在 http、服务器或位置 block 中更改。

syntax:     server_tokens on | off;
default: server_tokens on;
context: http, server, location

Enables or disables emitting nginx version in error messages and in the “Server” response header field.

来源:http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens

关于nginx - 是否可以更改不在 nginx.conf 中的 server_tokens 指令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23797790/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com