Nginx 根/位置组合

Nginx 根/位置组合

我有这样的配置:

server {
    server_name my.project.com;
    index index.php;
    root /project/api/v1.0;

    location /api/v1.0/ {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

我正在使用 Slim Framework,我的前端控制器位于 /project/api/v1.0/index.php 内。为什么它不起作用?我访问时出现超时且无响应https://my.project.com/api/v1.0/

相关内容