nginx和php隐藏版本号信息

星期四, 2016-12-29 | Author: Lee | php | 2,818 views

nginx 隐藏版本号 配置nginx.cnf server_tokens off; 即可

1
2
3
4
http {
    # ...省略一些配置
    server_tokens off;
  }

2.php 的版本信息 会在 HTTP头,以类似X-Powered-By: PHP/7.0.14 这种形式
在php.ini 中关闭 expose_php = Off 即可

1
2
3
4
5
6
7
8
9
10
;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
 
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
expose_php = On

对应改为记得重启下php 和对应的nginx

Tags: ,

文章作者: Lee

本文地址: https://www.pomelolee.com/1655.html

除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址

No comments yet.

Leave a comment

Search

文章分类

Links

Meta