要隐藏PHP在Nginx服务器上,您可以执行以下步骤:
/etc/nginx/nginx.conf
或/etc/nginx/conf.d/default.conf
。server
块中,找到或添加以下行来隐藏PHP文件的扩展名:location ~ \.php$ {
return 404;
}
sudo systemctl reload nginx
这样,当访问带有.php扩展名的文件时,Nginx将返回404错误,从而隐藏PHP文件的存在。
下一篇:php如何把时间戳转换为时间
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站