#代碼如下:
#在nginx.conf的server配置裏面寫上
#public/bd 不能訪問的路徑
location ~* ^/(public/bd)/.*.(php|php5)$ {
deny all;
}
#nginx -s reload 一般用這個比較合理==重啓過程不會影響
Service nginx restart
#更多詳細過程請看視頻
Nginx使用location設置某些目錄不能訪問php文件
#代碼如下:
#在nginx.conf的server配置裏面寫上
#public/bd 不能訪問的路徑
location ~* ^/(public/bd)/.*.(php|php5)$ {
deny all;
}
#nginx -s reload 一般用這個比較合理==重啓過程不會影響
Service nginx restart
#更多詳細過程請看視頻
Nginx使用location設置某些目錄不能訪問php文件