2

我试图让 Phreeze 安装在我的服务器上 - 一切都在服务器上,但问题是在我为 nginx 添加以下重写规则之后:

location ~ ^/phreeze/builder/(.*) {
    try_files /phreeze/builder/$1 /phreeze/builder/$1/ /phreeze/builder/index.php?_REWRITE_COMMAND=$1&args;
}

我的服务器所做的只是提示我下载实际文件。什么可能导致此问题?

我正在关注此文档: http: //phreeze.com/phreeze/documentation/installation.php

在文件中,我使用了他们的 nginx 重写规则,如下所示:

# PHREEZE CONF FILE FOR NGNIX 
#
# This is a partial example conf file to demonstrate how to configure
# URL rewriting in ngnix for Phreeze applications.  This example assumes
# that you are forwarding php requests to php-fpm via port 9000.
# you should be able to update the php location block without affecting
# the Phreeze location blocks
#
# Do not replace your entire ngnix.conf file with this, rather select the relevant
# location blocks.  PLEASE NOTE that the Phreeze application location blocks
# must appear *after* the ~ \.php$ location block, otherwise you will see server
# errors due to an infinite redirection loop

server {
    listen       8080;
    server_name  localhost;
    root   /path/to/htdocs;
    index  index.php index.html index.htm;

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    # NOTE: change "fastcgi_pass" to the correct port or socket as necessary 
    # based on your php-fpm configuration (ex. /tmp/php-fpm.sock)
    #
    location ~ \.php$ {
        include fastcgi.conf;
        fastcgi_intercept_errors on;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
    }

    # url rewriting for the phreeze builder application
    #
    location ~ ^/phreeze/builder/(.*) {
        try_files /phreeze/builder/$1 /phreeze/builder/$1/ /phreeze/builder/index.php?_REWRITE_COMMAND=$1&args;
    }

    # url rewriting for a Phreeze application called "example" 
    #
    location ~ ^/example/(.*) {
        try_files /example/$1 /example/$1/ /example/index.php?_REWRITE_COMMAND=$1&args;
    }

    # url rewriting for phreeze app that is installed in the htdocs root
    #
    #location ~ ^/(.*) {
    #    try_files /$1 /$1/ /index.php?_REWRITE_COMMAND=$1&args;
    #}

    # this is an alternate method of rewriting.  this method is discouraged
    # in the ngnix documentation for performance reasons, however it may be
    # helpful or necessary in some situations.  it's here for reference purposes only
    #
    #location ~ ^/example2/(.*) {
    #    if (!-e $request_filename){
    #        rewrite  ^/example2/(.*)$  /example2/index.php?_REWRITE_COMMAND=$1?  last;
    #    }
    #}
}

有任何想法吗?

谢谢!

4

1 回答 1

1

糟糕,我没有按照指示进行操作。nginx rewrite 块必须放在 location ~ .php$ { include fastcgi.conf; 之后 fastcgi_intercept_errors 开启;fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php;}

在你的重写文件上。笨拙的我。

于 2014-06-04T17:41:54.067 回答