When I try to use the larvel PHP framework, I try to put it in the /home/usr/proj/laravel , but as we know the public html laravel is resolved in /home/usr/proj/laravel/public , so my problem is how to make the nginx installation so that when I access using mysite.com/laravel/ or mysite.com/laravel , we are actually redirected to the location laravel/public/index.php .
In addition, it seems that there is a nignx rule proposed by an official laravel to make the URL look pretty.
location / { try_files $uri $uri/ /index.php?$query_string; }
How can I use this in my case?
UPDATE
The following code seems to work for me (but give me the NotFoundHttpException error in the line RouteCollection.php 145: possibly caused by the configuration of my router)
location /laravel{ root /home/usr/proj/laravel/public; index index.php index.html; try_files $uri $uri/ /laravel/public/index.php?$query_string; }
source share