Рабочий файл конфигурации nginx для WordPress

Рабочий файл конфигурации nginx для WordPress | neur0n.kz
server
    server_name ваш_домен;
    root /var/www/ваш_домен/public_html; # путь к корневой директории
    index index.php;
 
    access_log /var/www/ваш_домен/logs/access.log;
    error_log /var/www/ваш_домен/logs/error.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 ~ /\.
            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; # permalinks
 
    location ~ \.php$
            include /etc/nginx/fastcgi_params;
            fastcgi_pass unix:/tmp/php-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME /var/www/ваш_домен/public_html$fastcgi_script_name;