Конфигурация nginx для запуска Yii

Правильный конфиг выглядит примерно так:

server {
    server_name yiisite.loc;
    listen 80;

    root /var/www/yiisite;

    location / {
        index index.php index.htm index.html;
        try_files $uri $uri/ @yii;
    }

    location @yii {
        rewrite ^ /index.php last;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param YII_ENVIRONMENT production;
        fastcgi_pass 127.0.0.1:1234;
    }

    location /protected {
        deny all;
        access_log off;
    }

    location ~ /themes/\w+/views {
        deny all;
        access_log off;
    }

    location ~ /\. {
        deny all;
        access_log off;
    }
}