Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Setting up Laravel 5.1 project in a subfolder

$
0
0
Hi.

My nginx document root directory is /srv/http

Inside that directory i created another directory called finics. In that directory i moved a laravel project and add the following location block to my nginx configuration file.

[code]
location ^~ /finics {
root /srv/http/finics/public;

try_files $uri $uri/ /finics/index.php?$query_string;

location ~ \.php(?:$|/) {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
[/code]

Now when i visit localhost/finics, laravel returns me a NotFoundHttpException in RouteCollection.php line 161.

I posted that issue on laravel's forum but they couldn't find the problem.
I'm thinking that it might be due to the subfolder misconfiguration in nginx and that, creates a problem with the routes.

Any idea will be welcomed.

Thank you.

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>