The Zend Framework based site I have been working on is now being migrated to its production server. This server turns out to be nginx (surprise!). Naturally the site does not work correctly as it was developed on Apache and relies on an htaccess file.
My question is... anyone have any experience with this? Any ideas on how to translate what the htaccess file does to an nginx.conf file? I'm researching this but am hoping someone already has experience with this. Thanks!
EDIT: This is the current htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
This is "official", simple and works nice:
http://wiki.nginx.org/Zend_Framework#Time_for_nginx
If it were at all possible, I would recommend that they setup Apache on a nonstandard port accessible only from the Nginx box, and have Nginx proxy to Apache.
Nginx Proxy documentation
If you use a subdirectory for your project like http://some.url/myproject/controller/, then you also need to add setBaseUrl to your bootstrap file.
The nginx rewrite would look like this:
PS The question mark is not typo!
Actually i run a nginx with a drupal site that work like zend framework: one index.php as bootstrap
this is the rule (not tested on zend framework, just on drupal, but should be similar)
It's recommended to use try_files when ever possible.
For staging server that could help ;)