Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI 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开发者_如何学JAVA 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
精彩评论