0

I've this configuration:

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;
    }
}

I'm using Slim Framework and my front controller is inside /project/api/v1.0/index.php. Why this is not working? I'm having timeout and no response visiting https://my.project.com/api/v1.0/ .

3
  • You have no listen directive in your configuration, so your server is not listening on any port. Add something like listen 80 default_server; and connect through HTTP (not HTTPS). After you can configure a HTTPS server. Feb 25, 2020 at 7:17
  • 1
    @PiotrP.Karwasz it will be listening on port 80 as that is the default. Feb 25, 2020 at 10:05
  • You will get a timeout using https because you have not configured an https server. Your server is accepting connections for http only. Your root and location directives are confusing as they both include /api/v1.0/. If you want to use /api/v1.0/ in the URI, you should probably remove it from the root statement and use /api/v1.0/index.php at the end of the try_files statement. Feb 25, 2020 at 10:08

0

You must log in to answer this question.

Browse other questions tagged .