• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >Nginx > nginx中隐藏响应头/返回头信息/php版本号/服务器信息

nginx中隐藏响应头/返回头信息/php版本号/服务器信息

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含nginx php,nginx php配置,nginx php mysql,windows nginx php,nginx rewrite php等服务器相关知识,网友希望可以进行参考

有时我们不希望有人可以通过一些工具来返回我们服务器的信息,下面我来介绍在nginx中隐藏nginx响应头,修改nginx返回头信息,隐藏php版本号,隐藏服务器信息,同学可参考。

首先隐藏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;
}

响应头隐藏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


分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • nginx中隐藏响应头/返回头信息/php版本号/服务器信息
  • 指导:Ubuntu环境搭建nginx+php系统
  • Ubuntu下Nginx/PHP/MYSQL开发环境的配置方法

相关文章

  • Nginx下WordPress后台wp-admin不自动加斜杠的问题
  • 指导:Ubuntu环境搭建nginx+php系统
  • 使用Nginx给Google App Engine做负载均衡
  • Debian 7 安装LNMP服务器命令详解
  • nginx和apche如何自定义404的页面
  • Nginx 502 Bad Gateway错误的原因分析与解决方法
  • Nginx下设置虚拟主机的技巧一则
  • Nginx提示:413 Request Entity Too Large 的解决方法
  • nginx 配置禁止访问目录或文件
  • 更换apache到nginx的操作过程全记录

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • nginx支持.htaccess文件实现rewrite伪静态
    • Nginx怎么打开目录浏览功能(autoindex)
    • Nginx用户认证配置方法(域名/目录)详解
    • nginx location 指令匹配顺序
    • nginx和apche如何自定义404的页面
    • Ubuntu下Nginx/PHP/MYSQL开发环境的配置方法
    • nginx用mod_proxy实现反向代理配置
    • Nginx修改配置实现图片防盗链
    • Nginx 502 Bad Gateway错误的原因分析与解决方法
    • Windows 下安装 Nginx 服务并自动运行

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有