server {
    server_name example-project.test *.example-project.test;
    root    tests/Support/Projects/Laravel;

    
    index index.php;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to index.php
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
        fastcgi_index index.php;
        fastcgi_read_timeout 600;
        include fastcgi_params;
    }


    listen  443 ssl;
    ssl_certificate /etc/nginx/ssl/.crt;
    ssl_certificate_key /etc/nginx/ssl/.key;
}

server {
    listen  80;
    server_name example-project.test;

    if ($host = example-project.test) {
        return 301 https://$host$request_uri;
    }

    return 404;
}
