How to hide nginx apache php version information

不言
Release: 2023-04-02 13:58:01
Original
1603 people have browsed it

This article mainly introduces how to hide the version information of nginx apache php. It has certain reference value. Now I share it with you. Friends in need can refer to it.

You can see our server nginx and php versions are exposed. Let’s look at the hidden method

First, let’s look at the method of hiding the version number in nginx:
In the nginx configuration file nginx.conf, add the following code

server_tokens off
Copy after login

Let’s look at the method of hiding the version number in php: The method of hiding the version number in apache:
In the apache configuration file httpd.conf, add the following code

ServerTokens Prod
ServerSignature Off
Copy after login

In the php configuration file php.ini , add the following code

expose_php = Off
Copy after login

Okay, after the modification is completed, restart the service, let’s test it again:

insoz:~ insoz$ curl -I http://127.0.0.1//phpinfo.php
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 18 Jun 2015 02:41:47 GMT
Content-Type: text/html
Connection: keep-alive
Vary: Accept-Encoding
Copy after login

The above is the entire content of this article, I hope it will be helpful to everyone’s study, more Please pay attention to the PHP Chinese website for related content!

Related recommendations:

Common magic method functions and usage in PHP

The above is the detailed content of How to hide nginx apache php version information. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!