国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Nginx > 正文

Nginx隱藏服務器端各類信息的方法

2024-08-30 12:26:33
字體:
來源:轉載
供稿:網(wǎng)友

有時我們不希望有人可以通過一些工具來返回我們服務器的信息,下面我來介紹在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-phpexpose_php = Off

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宁德市| 清镇市| 马边| 随州市| 磴口县| 平泉县| 碌曲县| 武威市| 凤城市| 宿州市| 青海省| 安徽省| 银川市| 大理市| 凌源市| 布拖县| 黔西| 尚义县| 万全县| 井陉县| 报价| 南投市| 拜城县| 双辽市| 凤山县| 青铜峡市| 内乡县| 张家川| 赤壁市| 巩留县| 庐江县| 阳信县| 康乐县| 苗栗县| 峨山| 株洲县| 乌兰浩特市| 成武县| 图木舒克市| 浏阳市| 电白县|