[alibaba/tengine]如何隐藏服务器敏感信息?

2024-08-21 760 views
2
404 Not Found

The requested URL was not found on this server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!

URL:    http://tengine.taobao.org/get_error
Server: taocode-master
Date:   2016/01/18 16:16:36
-----------------------------------------------------------
Powered by Tengine

请问怎么隐藏掉主机名 Server: taocode-master?

回答

5

首先感谢楼上朋友的回复!

server_tag 指令 是tengine响应的 http header 里web server名称。 比如 apache ,nginx。

http {
    server_tag tws;
    ...
}

我想隐藏掉的是 错误页面里的 系统主机名 Server: xxxx # 上面信息里 url 下面那行。 这个名字是 服务器的 hostname , 不想暴露在外,应该怎么办呢?

3

哦 看错 server不能单独隐藏, 除非server_info off 所有的都不显示了.

8
server_info off;

目前先设置成这样了,@taoyuanyua 感谢!