歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 如何隱藏nginx和PHP版本號

如何隱藏nginx和PHP版本號

日期:2017/3/2 10:01:37   编辑:關於Linux

1、nginx

http
{
include mime.types;
default_type application/octet-stream;
server_tokens off;隱藏nginx版本
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;

2、php

修改php.ini 找到expose_php項 On 改成Off,

expose_php = Off

重啟:

/usr/local/php/sbin/php-fpm restart 和kill -HUP `cat /usr/local/nginx/logs/nginx.pid`即可。

Copyright © Linux教程網 All Rights Reserved