Php_fastcgi returns 404

Can not understand… My caddy does not work with php_fastcgi directive - I am always getting 404.
I am trying to use caddy with Laravel 8 for testing purposes.

PHP socket is on the place, php-fpm is up and running

$ ./caddy version                                                                                                                                                                    10.1m  Вт 12 янв 2021 14:19:30
v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=

Caddyfile:

{
	debug
}

http://localhost:8080 {
	root * /home/alexander/Work/Caddy/test/public
	php_fastcgi unix//run/php-fpm/php-fpm.sock
	file_server
}

response:

$ ./caddy run                                                                                                                                                                                                                      46.5s  Вт 12 янв 2021 14:09:18
2021/01/12 11:09:24.638 INFO    using adjacent Caddyfile
2021/01/12 11:09:24.640 INFO    admin   admin endpoint started  {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["127.0.0.1:2019", "localhost:2019", "[::1]:2019"]}
2021/01/12 11:09:24.641 INFO    tls.cache.maintenance   started background certificate maintenance      {"cache": "0xc000375a40"}
2021/01/12 11:09:24.641 DEBUG   http    starting server loop    {"address": "[::]:8080", "http3": false, "tls": false}
2021/01/12 11:09:24.641 INFO    tls     cleaned up storage units
2021/01/12 11:09:24.641 INFO    autosaved config        {"file": "/home/alexander/.config/caddy/autosave.json"}
2021/01/12 11:09:24.641 INFO    serving initial configuration
2021/01/12 11:09:29.483 DEBUG   http.handlers.rewrite   rewrote request {"request": {"remote_addr": "[::1]:44736", "proto": "HTTP/1.1", "method": "GET", "host": "localhost:8080", "uri": "/", "headers": {"User-Agent": ["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Sec-Fetch-Mode": ["navigate"], "Accept-Encoding": ["gzip, deflate, br"], "Accept-Language": ["ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,la;q=0.6"], "Cache-Control": ["max-age=0"], "Connection": ["keep-alive"], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Site": ["none"], "Sec-Fetch-User": ["?1"], "Sec-Fetch-Dest": ["document"], "Cookie": ["remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6Ik5kVDVTbXRsekdwNDVaQjdYWk8vWkE9PSIsInZhbHVlIjoiUjZHMDlSOGt0c1A4WFZUOW8weUZEZ0tHYitxM29raFl6OEpaRHIzMjc5N1FOZWY4L0sybWZwcTJkeGx3RkF2MTZGY3hITDV6SUU0dG15NG5pWHFCc1IxUFdtYWZaMVMzNkFyVmFtZEVBcnJ3RngvbU5RaFJ5bXF3QmNQQTVzWTUzYi93dkcyb3E0ajBhb1hKckZzRVJNY2tSMWlLaVhORlBhbTNobUpUSHgzbFJXTE5UcWZ5SVVLUnN6djdxUG1EcTN3SlRWa0FZU1pCUkY0eHZGa1l5d1J6cjZkTkE4YmZCcjQ0SmJuREVxRT0iLCJtYWMiOiIzMmNkY2ZkYTgwZGU4NWY3ZjI0MTlkYmYyOTg3NWZlOTk0Y2Y2OGI4NzY3NjM4OTI3MjU0ZmM5YmNjNzgyODc1In0%3D"]}}, "method": "GET", "uri": "/index.php"}
2021/01/12 11:09:29.483 DEBUG   http.reverse_proxy.transport.fastcgi    roundtrip       {"request": {"remote_addr": "[::1]:44736", "proto": "HTTP/1.1", "method": "GET", "host": "localhost:8080", "uri": "/index.php", "headers": {"Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Sec-Fetch-Mode": ["navigate"], "Accept-Encoding": ["gzip, deflate, br"], "Accept-Language": ["ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,la;q=0.6"], "Cache-Control": ["max-age=0"], "User-Agent": ["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Site": ["none"], "Sec-Fetch-User": ["?1"], "Sec-Fetch-Dest": ["document"], "Cookie": ["remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6Ik5kVDVTbXRsekdwNDVaQjdYWk8vWkE9PSIsInZhbHVlIjoiUjZHMDlSOGt0c1A4WFZUOW8weUZEZ0tHYitxM29raFl6OEpaRHIzMjc5N1FOZWY4L0sybWZwcTJkeGx3RkF2MTZGY3hITDV6SUU0dG15NG5pWHFCc1IxUFdtYWZaMVMzNkFyVmFtZEVBcnJ3RngvbU5RaFJ5bXF3QmNQQTVzWTUzYi93dkcyb3E0ajBhb1hKckZzRVJNY2tSMWlLaVhORlBhbTNobUpUSHgzbFJXTE5UcWZ5SVVLUnN6djdxUG1EcTN3SlRWa0FZU1pCUkY0eHZGa1l5d1J6cjZkTkE4YmZCcjQ0SmJuREVxRT0iLCJtYWMiOiIzMmNkY2ZkYTgwZGU4NWY3ZjI0MTlkYmYyOTg3NWZlOTk0Y2Y2OGI4NzY3NjM4OTI3MjU0ZmM5YmNjNzgyODc1In0%3D"], "X-Forwarded-For": ["::1"], "X-Forwarded-Proto": ["http"]}}, "dial": "/run/php-fpm/php-fpm.sock", "env": {"AUTH_TYPE":"","CONTENT_LENGTH":"","CONTENT_TYPE":"","DOCUMENT_ROOT":"/home/alexander/Work/Caddy/test/public","DOCUMENT_URI":"/index.php","GATEWAY_INTERFACE":"CGI/1.1","HTTP_ACCEPT":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","HTTP_ACCEPT_ENCODING":"gzip, deflate, br","HTTP_ACCEPT_LANGUAGE":"ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,la;q=0.6","HTTP_CACHE_CONTROL":"max-age=0","HTTP_COOKIE":"remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6Ik5kVDVTbXRsekdwNDVaQjdYWk8vWkE9PSIsInZhbHVlIjoiUjZHMDlSOGt0c1A4WFZUOW8weUZEZ0tHYitxM29raFl6OEpaRHIzMjc5N1FOZWY4L0sybWZwcTJkeGx3RkF2MTZGY3hITDV6SUU0dG15NG5pWHFCc1IxUFdtYWZaMVMzNkFyVmFtZEVBcnJ3RngvbU5RaFJ5bXF3QmNQQTVzWTUzYi93dkcyb3E0ajBhb1hKckZzRVJNY2tSMWlLaVhORlBhbTNobUpUSHgzbFJXTE5UcWZ5SVVLUnN6djdxUG1EcTN3SlRWa0FZU1pCUkY0eHZGa1l5d1J6cjZkTkE4YmZCcjQ0SmJuREVxRT0iLCJtYWMiOiIzMmNkY2ZkYTgwZGU4NWY3ZjI0MTlkYmYyOTg3NWZlOTk0Y2Y2OGI4NzY3NjM4OTI3MjU0ZmM5YmNjNzgyODc1In0%3D","HTTP_HOST":"localhost:8080","HTTP_SEC_FETCH_DEST":"document","HTTP_SEC_FETCH_MODE":"navigate","HTTP_SEC_FETCH_SITE":"none","HTTP_SEC_FETCH_USER":"?1","HTTP_UPGRADE_INSECURE_REQUESTS":"1","HTTP_USER_AGENT":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36","HTTP_X_FORWARDED_FOR":"::1","HTTP_X_FORWARDED_PROTO":"http","PATH_INFO":"","QUERY_STRING":"","REMOTE_ADDR":"::1","REMOTE_HOST":"::1","REMOTE_IDENT":"","REMOTE_PORT":"44736","REMOTE_USER":"","REQUEST_METHOD":"GET","REQUEST_SCHEME":"http","REQUEST_URI":"/","SCRIPT_FILENAME":"/home/alexander/Work/Caddy/test/public/index.php","SCRIPT_NAME":"/index.php","SERVER_NAME":"localhost","SERVER_PORT":"8080","SERVER_PROTOCOL":"HTTP/1.1","SERVER_SOFTWARE":"Caddy/v2.3.0"}}
2021/01/12 11:09:29.484 DEBUG   http.handlers.reverse_proxy     upstream roundtrip      {"upstream": "unix//run/php-fpm/php-fpm.sock", "request": {"remote_addr": "[::1]:44736", "proto": "HTTP/1.1", "method": "GET", "host": "localhost:8080", "uri": "/index.php", "headers": {"X-Forwarded-For": ["::1"], "X-Forwarded-Proto": ["http"], "Upgrade-Insecure-Requests": ["1"], "Sec-Fetch-Site": ["none"], "Sec-Fetch-User": ["?1"], "Sec-Fetch-Dest": ["document"], "Cookie": ["remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6Ik5kVDVTbXRsekdwNDVaQjdYWk8vWkE9PSIsInZhbHVlIjoiUjZHMDlSOGt0c1A4WFZUOW8weUZEZ0tHYitxM29raFl6OEpaRHIzMjc5N1FOZWY4L0sybWZwcTJkeGx3RkF2MTZGY3hITDV6SUU0dG15NG5pWHFCc1IxUFdtYWZaMVMzNkFyVmFtZEVBcnJ3RngvbU5RaFJ5bXF3QmNQQTVzWTUzYi93dkcyb3E0ajBhb1hKckZzRVJNY2tSMWlLaVhORlBhbTNobUpUSHgzbFJXTE5UcWZ5SVVLUnN6djdxUG1EcTN3SlRWa0FZU1pCUkY0eHZGa1l5d1J6cjZkTkE4YmZCcjQ0SmJuREVxRT0iLCJtYWMiOiIzMmNkY2ZkYTgwZGU4NWY3ZjI0MTlkYmYyOTg3NWZlOTk0Y2Y2OGI4NzY3NjM4OTI3MjU0ZmM5YmNjNzgyODc1In0%3D"], "Cache-Control": ["max-age=0"], "User-Agent": ["Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"], "Accept": ["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"], "Sec-Fetch-Mode": ["navigate"], "Accept-Encoding": ["gzip, deflate, br"], "Accept-Language": ["ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,la;q=0.6"]}}, "duration": 0.000785882, "headers": {"Status": ["404 Not Found"], "X-Powered-By": ["PHP/7.4.13"], "Content-Type": ["text/html; charset=UTF-8"]}, "status": 404}
2021/01/12 11:09:29.661 DEBUG   http.handlers.file_server       sanitized path join     {"site_root": "/home/alexander/Work/Caddy/test/public", "request_path": "/favicon.ico", "result": "/home/alexander/Work/Caddy/test/public/favicon.ico"}
2021/01/12 11:09:29.661 DEBUG   http.handlers.file_server       opening file    {"filename": "/home/alexander/Work/Caddy/test/public/favicon.ico"}

Static files serving just fine.

I do not know what to do :((

Your Laravel app must be returning the 404, because we see "X-Powered-By": ["PHP/7.4.13"] in the response.

Take a look at your Laravel logs, maybe you misconfigured something in your router.

That config is known to work with Laravel apps (I use it myself, much the same way).