server {
listen 80;
server_name config.xxxx.com;
access_log /data/nginx/logs/config.xxxx.com/config.xxxx.com.log main;
location / {
root /data/www/config;
index index.php;
}
location ~ \.php$ {
root /data/www/config;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
###################################
###################################
我之前沒有加“ location / ”出現如上圖所示的問題,訪問域名出現nginx歡迎界面,然後域名後面加上index.php雖然出現的登陸界面,但是明顯感覺有很多js,html等等文件沒有加載出來。
然後我領導告訴我“ location ~ .php$ “ location只匹配後綴爲.php的文件,js,html等文件是找不到的,所以大哥要碟不。