doubaoxue5788 2014-07-08 07:14
浏览 59
已采纳

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

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.

So the root www.mysite.com works, but www.mysite.com/login or www.mysite.com/signup does not. Just a blank white page.

I've looked at the /var/log/nginx/error.log and have enabled errors by adding...

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. I'm kind of a noob to Nginx.

UPDATE:

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

  • 写回答

1条回答 默认 最新

  • dongrong7883 2014-07-08 07:23
    关注

    Maybe try setting display_errors = On in the php.ini in case it's not calling the index.php?

    Also, have you got your NginX rewrite / /index.php; in place for the site?

    See Magento - Wiki - Configuring nginx for Magento

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后的密码
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面