我是 nginx 新手,我只是无法确定为什么我的 nginx 配置无法按预期工作。我想要做的就是让 nginx 为每个 web 根 (/) 请求优先考虑 index.html 而不是 index.php。
这是我的 nginx 配置:
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
    worker_connections 768;
    multi_accept on;
}
http {
    ##
    # Basic Settings
    ##
    server {
        location / {
            index   index.html index.php;
        }
        location ~ \.php$ {
            fastcgi_pass  localhost:9000;
            fastcgi_param SCRIPT_FILENAME
                          $document_root$fastcgi_script_name;
            include       fastcgi_params;
        }
    }
    sendfile on;
    tcp_nopush on;
    tcp_nodelay off;
    keepalive_timeout 15;
    keepalive_requests 100000;
    types_hash_max_size 2048;
    client_body_in_file_only clean;
    client_body_buffer_size 32K;
    client_max_body_size 300M;
    server_tokens off;
    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    ----------------- cut ---------------
    ##
    # Virtual Host Configs
    ##
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
我的错误在哪里?编写这个 nginx 配置的正确方法是什么?