安全问题无小事,死生之地,存亡之道,不可不察也。有关web站点安全设置可以参见:nginx安全配置、Linux下Apache安全配置策略、lnmp架构下php安全配置分享、确保nginx安全的10个技巧、Linux系统必备安全配置。
本文主要讲述针对nginx、Apache、lighthttpd三大web容器的针对某个特定的目录禁止执行PHP等程序。文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-apache-lighthttpd-disable-php-execute-of-special-directory/
nginx
location /upload/ { location ~ .*\.(php)?$ { deny all; } }
location ~* ^/(upload|images)/.*\.(php|php5)$ { deny all; }
Apache
<Directory /webroot/attachments> php_flag engine off </Directory>
lighthttpd
$HTTP["url"] =~ "^/(forumdata|templates|upload|images)/" { fastcgi.server = () }文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-apache-lighthttpd-disable-php-execute-of-special-directory/文章源自运维生存时间-https://www.ttlsa.com/nginx/nginx-apache-lighthttpd-disable-php-execute-of-special-directory/

我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
评论