M
M
Matvey Mamonov2015-06-28 21:41:20
Nginx
Matvey Mamonov, 2015-06-28 21:41:20

What would this code look like on NginX?

The essence of the code is that all requests will be processed by the index.php file.
When I had Apache, everything was clear: I wrote it in .htaccess and you're done.
But recently I moved to NginX. How to do the same on NginX ?

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rikcon, 2015-06-28
@eucalipt

location / {
        try_files \$uri \$uri/ /index.php?\$query_string;
    }

here, try it, pulled from the Laravel Homestead config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question