Skip to content

Instantly share code, notes, and snippets.

@prinsss
Created December 25, 2016 06:21
Show Gist options
  • Select an option

  • Save prinsss/9668e0a8a9e2bdeaa6da218186eeda7c to your computer and use it in GitHub Desktop.

Select an option

Save prinsss/9668e0a8a9e2bdeaa6da218186eeda7c to your computer and use it in GitHub Desktop.
Chereveto rewrite rules for Nginx
location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
try_files $uri $uri/ /api.php;
}
location /admin {
try_files $uri /admin/index.php?$args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment