Sarajevo, Bosnia and Herzegovina

How to spin the Zend Framework on nginx ?


As you might know, on nginx there is no .htaccess file. So you must specify your routing in .vhost file. Here is an example of one zend page that is spining on nginx. Enjoy!

server {
        listen 111.222.333.444:80;
        root   /var/www/;
        index index.html index.htm index.php index.cgi index.xhtml;
        location ~ \.shtml$ {
            ssi on;

        error_log /var/log/ispconfig/httpd/;
        access_log /var/log/ispconfig/httpd/ combined;
        location / {
                # This is cool because no php is touched for static content
                try_files $uri $uri/ /index.php?$args;

        location ~ \.php$ {
            #try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;

        location /cgi-bin/ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            root /var/www/clients/client1/web10;
            gzip off;
            fastcgi_pass  unix:/var/run/fcgiwrap.socket;
            fastcgi_index index.cgi;
            fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;

Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.