V
V
vrazbros2019-06-29 13:45:01
Nginx
vrazbros, 2019-06-29 13:45:01

How to raise routing works in Laravel in docker container?

I can't figure out why Laravel's routing isn't working. I go to the rest page for which routing is specified, but nginx returns 404. Lara is installed in docker container nginx + php-fpm Lara
5.8
controller is used

class RestTestController extends Controller
{
    public function index()
    {
        echo "hello";
    }
}

here is the code for the route
Route::resource('rest', 'RestTestController')->names('restTest');

mysite.local - Lara page opens
mysite.local/rest - 404 not found
here is the whole code on github https://github.com/baddoctor/poligon

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-06-29
@vrazbros

You need to set up a single entry point, for this, write the following code in location / try_files $uri $uri/ /index.php?$query_string;it will redirect all requests to Laravel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question