Wednesday, January 11, 2017

nginx + php-fpm + wordpress, dynamic cache

Add to /etc/nginx/nginx.conf to http section

log_format  cache '$remote_addr - [$time_local] "$host$request_uri" $status $upstream_cache_status';
fastcgi_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=dynamic:100m inactive=5m;
fastcgi_cache_key "$scheme://$host$request_uri";

Add to your virtualhost to location section

        fastcgi_pass_header "X-Accel-Redirect";
        fastcgi_pass_header "X-Accel-Expires";
        fastcgi_cache dynamic;
        fastcgi_cache_key $scheme$host$request_uri$request_method;
        fastcgi_pass_header Set-Cookie;
        fastcgi_pass_header Cookie;
        fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
        fastcgi_cache_valid 200 301 302 10m;
        access_log /var/log/nginx/access-cache.log cache;

then reload nginx

nginx -t && nginx -s reload

Thats all

grub2-install: error: disk `mduuid/e54081d398c6d57b4d67436f6d032162' not found

After raid 1 disk replacement faced with this issue # grub2-install /dev/sdb Installing for i386-pc platform. grub2-install: error: disk `md...