fuelphp应用程序和nginx在内部重定向时产生500个错误重写或内部重定向周期

fuelphp应用程序和nginx在内部重定向时产生500个错误重写或内部重定向周期,nginx,rewrite,fuelphp,Nginx,Rewrite,Fuelphp,我正在用fuelphp编写一个应用程序。在我当地的流浪者包厢里,一切都很完美。我已经从我的主服务器为开发箱创建了一个子域,转发到一个数字海洋水滴的IP,安装了nginx、php5 fpm和所有其他使燃料正常工作所需的位,主页正常工作,但是当我尝试导航到站点的任何其他区域时,我在error.log中得到了这个错误 2013/12/06 22:54:46 [error] 10177#0: *2 rewrite or internal redirection cycle while internall

我正在用fuelphp编写一个应用程序。在我当地的流浪者包厢里,一切都很完美。我已经从我的主服务器为开发箱创建了一个子域,转发到一个数字海洋水滴的IP,安装了nginx、php5 fpm和所有其他使燃料正常工作所需的位,主页正常工作,但是当我尝试导航到站点的任何其他区域时,我在error.log中得到了这个错误

2013/12/06 22:54:46 [error] 10177#0: *2 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: xxx.xxx.xxx.xxx, server: xxx.xxxxxxx.com, request: "GET /region HTTP/1.1", host: "xxx.xxxxxxx.com"
虚拟主机的.conf为:

server {


    root /usr/share/nginx/html/fuel_app/public;
    server_name xxx.xxxxxxx.com;

    location / {
            index index.php index.html index.htm;
            try_files $uri $uri/ /index.html;
    }

    error_page 404 /404.html;

#        error_page 500 502 503 504 /50x.html;
#        location = /50x.html {
#              root /usr/share/nginx/html/fuel_app/public;
#        }

    location @handler {
            rewrite / /index.php;
    }

    location ~ .php/ {
            rewrite ^(.*.php)/ $1 last;
    }

    location ~ .php$ {
            if (!-e $request_filename) { rewrite / /index.php last; }
            expires        off;
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }
}

我在这里遗漏了什么?

我不是专家,但这是我们在生产nginx和php fpm时使用的配置:

server {

listen            80;
server_name       www.yourserver.com
root              /var/www/YOURSITE/public;  # whatever is yours
index             index.php index.html index.htm;

location / {
    try_files   $uri $uri/ @handler;
    expires     30d;
}

location @handler {
    rewrite ^ /index.php?/$request_uri;
}

location ~ ^/index.php$ {
    fastcgi_pass        127.0.0.1:9000;
    fastcgi_index       index.php;
    fastcgi_param       SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param       PHP_VALUE open_basedir="/var/www/YOURSITE/:/usr/share:/tmp/";
    include             fastcgi_params;
}

location ~ \.php$ {
    deny all;
}

location ~* ^/(modules|application|system) {
    return 403;
}

error_page 404          /index.php;

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny  all;
}

access_log /var/log/nginx/YOURSITE.it-access.log;
error_log /var/log/nginx/YOURSITE.it-error.log;

}
我们有一些不同的设置,可能是其中之一。我要检查的另一件事是config.php。在许多项目中,我们必须手动设置基本url,也许您也必须这样做,或者您已经解决了它,您必须为您的生产配置更改它