nginx中怎么禁止目錄PHP執行權限
1 回答

撒科打諢
TA貢獻1934條經驗 獲得超2個贊
首先,編輯nginx的虛擬主機配置,在fastcgi的location語句的前面添加如下內容:
1、單個目錄去掉PHP執行權限
location ~ /attachments/.*.(php|php5)?$ {
deny all;
}
將attachments目錄的PHP執行權限去掉。
2、多個目錄去掉PHP執行權限
ocation ~ /(attachments|upload)/.*.(php|php5)?$ {
deny all;
}
將attachments、upload這二個目錄的PHP執行權限去掉。
- 1 回答
- 0 關注
- 999 瀏覽
添加回答
舉報
0/150
提交
取消