Answer the question
In order to leave comments, you need to log in
Why does Laravel get 404 not found on the root route from under Docker?
Good afternoon.
Why, with a similar configuration on local in docker, a site on laravel 8 correctly processes routes, but on a VPS :
404 not found
cant somewhere inside /public/index.php
$response = tap($kernel->handle(
$request = Request::capture()
))->send();
Route::get('/', function () {
return view('welcome');
});
sudo docker-compose exec php-cli php artisan route:list;
server {
listen 443 ssl;
server_name www.domen.ru domen.ru;
charset utf-8;
index index.php;
root /var/www/public;
client_max_body_size 30M;
location / {
try_files $uri /index.php?$args;
}
class RouteServiceProvider extends ServiceProvider {
...
protected $namespace = 'App\\Http\\Controllers';
...
}
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
Answer the question
In order to leave comments, you need to log in
If you're interested:
./app/app/Http/Kernel.php Commented
out this thing, now it's ok:
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question