简体   繁体   中英

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.

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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