Tiki Wiki CMS GroupwareのNginxの設定

.htaccessが複雑で非常にしんどい、なぜそんな仕様に・・・・。

server {
    listen       80;
    server_name  {server_name};

    root         /var/www/vhosts/tiki;

    location / {
        index index.php index.html index.htm;
    }

    location ~ ^/(db|db/cert|installer|tiki_tests/tests|templates|modules)/\. {
        deny all;
    }

    location ~ ^(/vendor/ezyang/htmlpurifier/benchmarks/|/vendor/ezyang/htmlpurifier/maintenance/) {
        deny all;
    }

    location ~ ^/permissioncheck/.*(bak|inc|inc\.php|lib|sh|sql|tpl)$ {
        deny all;
    }

    location ~ ^/lang/.*[^j][^s]$ {
        deny all;
    }

    location ~ ^/lib/.*\.php$ {
        deny all;
    }

    location ~ ^/temp/(?!.*png$)(?!public).* {
        deny all;
    }

    location ~ \.php$ {
        fastcgi_pass   phpfpm;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_read_timeout 90;
        include        fastcgi_params;
    }
}