server { listen 80; server_name blog.mydomain.ru; root /var/www/html/blog; index index.php; access_log /var/log/nginx/access.blog.mydomain.ru.log; error_log /var/log/nginx/error.blog.mydomain.ru.log; gzip on; gzip_disable "msie6"; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; location ~ /(\.|wp-config\.php|readme\.html|license\.txt) { deny all; } location ~* /(?:uploads|files)/.*\.php$ { deny all; } location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm-blog.sock; fastcgi_index index.php; include fastcgi_params; } }