Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx Security Notes (modify nginx header information and incorrectly display version number)

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Notes are welcome:

Modify nginx header information and error display version number

1. Hide version number:

nginx configuration file nginx.conf Find http column Add:

server_tokens off;

2. Change the name of nginx displayed

Need to modify the source code file:

/opt/soft/nginx-1.2.0/src/http/ngx_http_special_response.c

vi /opt/soft/nginx-1.2.0/src/http/ngx_http_special_response.c

Find 29 lines:

29 "LLSERVER" CRLF ##modified to desired name

/opt/soft/nginx-1.2.0/src/http/ngx_http_header_filter_module.c

vi /opt/soft/nginx-1.2.0/src/http/ngx_http_header_filter_module.c

Find lines 49 and 50:

static char ngx_http_server_string[] = "Server: LLSERVER" CRLF;

static char ngx_http_server_full_string[] = "Server: LLSERVER " NGINX_VER CRLF;

Change it to the appropriate name.

When visiting again:

404 Not Found

LLSERVER

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report