Purpose to change the name and version number of the source code hidden software#define NGINX_VERSION “nginx_stable” #This line modifies the version number you want#define NGINX_VER “linuxprobe/” NGINX_VERSION #This line modifies the name of the software you want to modify
[root@linuxprobe nginx-1.10.1]# vim +49 src/http/ngx_http_header_filter_module.c
Copy after login
Modify the connection field in the HTTP header information to prevent the specific version number from being echoedExtension: general http Header fieldsGeneral header fields include header fields supported by both request and response messages. Common header fields include Cache-Control, Connection, Date, Pragma, Transfer-Encoding, Upgrade, and Via. If the common header field is extended, both parties need to support this extension. If there is an unsupported general header field, it will generally be treated as an entity header field. Some devices or software are able to obtain connection information, while others are not. If you want to completely hide it, you must do comprehensive confidentialitystatic char ngx_http_server_string[] = "Server: LinuxprobeWeb" CRLF;
[root@linuxprobe nginx-1.10.1]# vim +29 src/http/ngx_http_special_response.c
Copy after login
Defines the return of http error codesSometimes there is an error in our page program, Nginx will return the corresponding error code on our behalf. When echoed, it will bring nginx and version number, and we hide it Get up
The above is the detailed content of How to install and tune Nginx. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn