I have a nginx server with work with php by fast cgi. when I use a rewrite like this:
rewrite "^/tested\.html" /index.html last;
everything is ok, and page index.html shown for tested.html, but when my target is a php file like this:
rewrite "^/tested\.html" /index.php last;
a download dialogbox is opened and when I save the file, I saw it contain my php codes!!!
anyone can help me?
NginX does not know how to execute PHP code, so instead your browser will just be given a text file with PHP in it.
Similarly to Apache where you need to install a module for PHP, on NginX, you need to install something like PHP FPM