Given the following Caddyfile and a fresh Laravel setup with the following routes:
root ./public
fastcgi / /var/run/php5-fpm.sock php
errors error.log
<?php
Route::get('/', function () {
return view('welcome');
});
Route::get('/foo', function () {
return 'bar';
});
The index route works perfectly, but the /foo
route can only be accessed at /index.php/foo
.
The recommended NGINX configuration for Laravel is:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
Don't know if that helps?
This should work
rewrite {
r .*
ext /
to /index.php?{query}
}
Perfect :ok_hand:
You're my hero @abiosoft :)
Most helpful comment
This should work