Skip to content
Advertisement

Symfony routing: only `/` page is working

I’m having a strange symfony problem. I’m trying to play with Symfony 3.4 and nginx.

I follow the “Create your First Page” tutorial but, only**/symfony/Symfony/web/app_dev.php** page is working when I using URL /symfony/Symfony/web/app_dev.php/lucky/number, IT SHOW

“nginx error! The page you are looking for is not found.”

LuckyController.php

JavaScript

nginx.conf

JavaScript

routing.yml

JavaScript

Advertisement

Answer

I think the configuration you are using for nginx is the one for symfony 4.x and not 3.4

I see that you root and location ~ ^/index.php(/|$) { are wrong.

the root should contains “web” and the location should contains “app_dev” and and other on “app”.

check the documentation on symfony, it is well done 🙂

https://symfony.com/doc/3.4/setup/web_server_configuration.html#nginx

P.S. If you are starting symfony, I would suggest you to start with symfony 4, it is the newest version

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement