nginx配置php站点代理

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 ...

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等文件是找不到的,所以大哥要碟不。

本文标题为:nginx配置php站点代理

基础教程推荐