欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Nginx隱藏服務(wù)器端各類信息的方法

 更新時(shí)間:2015年07月09日 10:52:41   投稿:goldensun  
這篇文章主要介紹了Nginx隱藏服務(wù)器端各類信息的方法,包括隱藏HTTP頭信息和PHP版本號(hào)等等,需要的朋友可以參考下

有時(shí)我們不希望有人可以通過(guò)一些工具來(lái)返回我們服務(wù)器的信息,下面我來(lái)介紹在nginx中隱藏nginx響應(yīng)頭,修改nginx返回頭信息,隱藏php版本號(hào),隱藏服務(wù)器信息,同學(xué)可參考。

首先隱藏nginx版本信息,只需編輯 nginx.conf 文件
添加一行

server_tokens off;

http {
  include    /etc/nginx/mime.types;
  default_type application/octet-stream;
  index index.php index.html index.htm;
  server_tokens off;
 
  log_format main '$remote_addr - $remote_user [$time_local] "$request" '
           '$status $body_bytes_sent "$http_referer" '
           '"$http_user_agent" "$http_x_forwarded_for"';
 
  access_log /var/log/nginx/access.log main;
 
  sendfile    on;
  #tcp_nopush   on;
 
  keepalive_timeout 65;
 
  #gzip on;
 
  include /etc/nginx/conf.d/*.conf;
}

響應(yīng)頭隱藏PHP版本休息,編輯php.ini文件找到expose_php = On , 修改為 expose_php = Off

;;;;;;;;;;;;;;;;;
; 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://www.php.net/manual/en/ini.core.php#ini.expose-php
expose_php = Off

相關(guān)文章

最新評(píng)論