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

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

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

2024-08-30 12:22:10
字體:
供稿:網(wǎng)友
這篇文章主要介紹了Nginx隱藏服務(wù)器端各類信息的方法,包括隱藏HTTP頭信息和PHP版本號等等,需要的朋友可以參考下

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

首先隱藏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-phpexpose_php = Off

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 富阳市| 桦川县| 汕尾市| 和田市| 十堰市| 阿克陶县| 康平县| 张家港市| 莱州市| 京山县| 微博| 昌平区| 曲松县| 陕西省| 定结县| 青阳县| 泾阳县| 拉萨市| 海淀区| 岳阳市| 静安区| 双流县| 平陆县| 惠水县| 汾阳市| 灵宝市| 钟山县| 保定市| 康平县| 垣曲县| 石泉县| 通城县| 思茅市| 定边县| 兴国县| 墨江| 湘西| 哈尔滨市| 远安县| 孟津县| 平山县|