Zend Nginx路由是空白页面,没有错误

时间:2014-07-08 07:14:18

标签: php zend-framework nginx

最近将一个站点从一个LAMP移动到一个LEMP设置,我遇到了麻烦,因为主站点页面很好,但是所有子页面路径都只是空白页面而没有输出错误。

因此www.mysite.com的根目录有效,但www.mysite.com/login或www.mysite.com/signup没有。只是一个空白的白页。

我查看了/var/log/nginx/error.log,并通过添加...启用了错误。

ini_set('display_startup_errors',1);
ini_set('display_errors',1);
error_reporting(-1);

...在我的index.php中,我不确定Nginx会做什么。我对Nginx来说是一个菜鸟。

更新:

所以看来htaccess规则并没有得到NginX的认可:

RewriteEngine On

# Force SSL
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.mysite.com/$1 [R,L]

# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]


# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::^B$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

如何让NginX使用这些规则?

1 个答案:

答案 0 :(得分:0)

如果它没有调用index.php,也许可以尝试在php.ini中设置display_errors = On

此外,您是否已为该网站安装了NginX rewrite / /index.php;

请参阅Magento - Wiki - Configuring nginx for Magento