server { listen 8880; server_name localhost; #access_log /var/log/zdir.log combined; index index.html index.htm index.php; root /data/wwwroot/default; location ^~ /templates { if ( !-e $request_filename ){ rewrite ^/templates/(.*) /data/templates/$1 last; } } location / { try_files $uri $uri/ /index.php?$query_string; } location ~* \.(db3|json)$ { deny all; } location ~* ^/(temp|upload|imgs|data|application|static|system)/.*.(php|php5)$ { return 403; } location ~ [^/]\.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { expires 30d; access_log off; } location ~ .*\.(js|css)?$ { expires 7d; access_log off; } location ~ /\.ht { deny all; } }