nginx使用location設置某些目錄不能訪問php文件

#代碼如下:
#在nginx.conf的server配置裏面寫上
#public/bd 不能訪問的路徑

location ~* ^/(public/bd)/.*.(php|php5)$ {
         deny all; 
}
#nginx -s reload 一般用這個比較合理==重啓過程不會影響
Service nginx restart

#更多詳細過程請看視頻

Nginx使用location設置某些目錄不能訪問php文件

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章