Rewrite all requests to index.php with nginx

I have tried this and succeeded to get my index page.
When I have added this code in my site configuration file:

location / {
    try_files $uri $uri/ /index.php;
}

Inside the configuration file itself it is explained that these are the configured steps

First attempt to serve request as file,
then as directory,
then fall back to index.html

In my case it is index.php, as I am providing page through php code.

Leave a Comment