开发者

nginx rewrite rules to php files open a download dialog box? [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

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开发者_如何学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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜