简体   繁体   English

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

[英]Zend Nginx routes are blank pages with no errors

Recently moved a site over from a LAMP to a LEMP setup and I'm having trouble as the main site page comes up fine but all the sub page routes are just blank white pages with no errors being output. 最近将站点从LAMP移到了LEMP设置,由于主站点页面显示正常,但我遇到了麻烦,但是所有子页面路由都是空白白页,没有错误输出。

So the root www.mysite.com works, but www.mysite.com/login or www.mysite.com/signup does not. 因此根目录www.mysite.com起作用,但www.mysite.com/login或www.mysite.com/signup无效。 Just a blank white page. 只是一张空白的白纸。

I've looked at the /var/log/nginx/error.log and have enabled errors by adding... 我查看了/var/log/nginx/error.log并通过添加...启用了错误。

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

...in my index.php, which I'm not sure does anything with Nginx. ...在我的index.php中,我不确定用Nginx做任何事情。 I'm kind of a noob to Nginx. 我对Nginx有点陌生。

UPDATE: 更新:

So it seems the htaccess rules aren't recognized by 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]

How can I get NginX to operate with these rules? 我怎样才能让NginX使用这些规则?

Maybe try setting display_errors = On in the php.ini in case it's not calling the index.php? 也许在不调用index.php的情况下尝试在php.ini中设置display_errors = On

Also, have you got your NginX rewrite / /index.php; 另外,您是否已经rewrite / /index.php; in place for the site? 该网站的位置?

See Magento - Wiki - Configuring nginx for Magento 参见Magento-Wiki-为Magento配置nginx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM