Timbertlt
2 weeks ago
1170
3
Servers

Laravel 6.0 render nginx 404 error

Posted 2 weeks ago by Timbertlt

Upgraded my app from 5.8 to 6.0.4. The nginx config is the same:

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

location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include /etc/nginx/fastcgi_params;
        ..........
        fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}

wep.php config:

.....
some app routes
.....
Route::get('/{page}',[
    'uses'  => '[email protected]',
    'as'    => 'page'
]);

Route::fallback('[email protected]');

On laravel 5.8 if the route does not exist, I get 404 error rendered by laravel.

On laravel 6.0 I get nginx 404 error.

Is it the problem with laravel routing or do I need to change something in nginx config?

Please sign in or create an account to participate in this conversation.