當前位置:編程學習大全網 - 網站源碼 - nginx中怎樣指定多個目錄不解析php

nginx中怎樣指定多個目錄不解析php

多個目錄去掉PHP執行權限

代碼如下 復制代碼

location ~ /(attachments|upload)/.*.(php|php5)?$ {

deny all;

}

將attachments、upload這二個目錄的PHP執行權限去掉。

附,完整的虛擬主機配置:

代碼如下 復制代碼

server{

listen 80;

server_name www.51qgj.com;

index index.html index.htm index.php;

root /home/wwwroot/w123;

include discuz.conf;

location ~ /(attachments|upload)/.*.(php|php5)?$ {

deny all;

}

location ~ .*.(php|php5)?$

{

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fcgi.conf;

}

access_log off;

}

  • 上一篇:bigboss的源代碼是什麽?
  • 下一篇:星球重啟海東青和夜襲者哪個好
  • copyright 2024編程學習大全網