Answer the question
In order to leave comments, you need to log in
Laravel + nginx bundle?
Good afternoon. Switched from Apache to nginx (using the isp panel).
Now all laravel pages give errors (404 not found [nginx]).
How do I set up the old .htaccess file? They say that it does not work at all in nginx, but I inserted the following information into it:
# nginx configuration
location / {
rewrite ^/(.*)/$ /$1 redirect;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php break;
}
}
Answer the question
In order to leave comments, you need to log in
laravel.com/docs/5.1/installation
location / {
try_files $uri $uri/ /index.php?$query_string;
}
In .htaccess, you can now also write your pedigree and insert photos of the cat, because you no longer need it (file).
The nginx configuration files are usually located in /etc/nginx/sites-available
there and add your configurations
I would like to add to the topic starter's question.
Is there a more complete nginx config for Laravel somewhere?
Like this for Symfony, for example:
symfony.com/doc/current/setup/web_server_configura...
Although for Symfony (and some others) there is the same config description even in the Nginx documentation, but for Laravel for some reason nothing no:
https://www.nginx.com/resources/wiki/start/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question