A Finnaly encontrou uma solução para isso:
server {
server_name domain.com www.domain.com;
root /var/www/domains/domain.com/htdocs/public;
access_log /var/log/nginx/domains/domain.com/access.log;
error_log /var/log/nginx/domains/domain.com/error.log; index index.php index.htm;
auth_basic_user_file /var/www/domains/htpasswd/domain.com.htpasswd; location ~ /.svn/ { deny all; } location ~ /.htaccess { deny all; } location ^~ /psp/callback/ { auth_basic off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.domain.com.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/domains/domain.com/htdocs/public$fastcgi_script_name; } location / { auth_basic "Restricted"; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.domain.com.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/domains/domain.com/htdocs/public$fastcgi_script_name; } # Zend Framework rewrite if (!-e $request_filename) { set $zfRewrite 1; } if ($zfRewrite = 1) { rewrite ^.*$ /index.php last; }
}