Possible to configure nginx to ignore cache for logged in users in certain roles only?

Here is what I ended up doing: // Set disable cache for certain roles add_action(‘init’, ‘add_custom_cookie_admin’); function add_custom_cookie_admin() { if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); $thisrole = $current_user->roles[0]; if($thisrole !== ‘subscriber’) { setcookie(“disable_cache”, $current_user->user_login, time()+43200, COOKIEPATH, COOKIE_DOMAIN); } } } // and then remove the cookie on logout function clear_custom_cookie_on_logout() { unset($_COOKIE[“disable_cache”]); setcookie( … Read more

Multisite WordPress nginx uploaded files throw 404

I solved the problem by upgrading the way files are uploaded and displayed to the new WordPress 3.5 method. A more detailed tutorial can be found at http://halfelf.org/2012/dumping-ms-files/ but the basic steps are as follows: Move images from blogs.dir/#/files/ to /uploads/sites/#/ Change WordPress settings so it doesn’t look in /files/ but in /uploads/sites/#/ In .htaccess … Read more

Block PHP Files Nginx

Ok found the answer. You need to put this directive above the location: location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } The order apparently matters inside the nging conf file.

WordPress media upload “HTTP error”

I figured out how to fix my problem. In my nginx config file (/etc/nginx/nginx.conf) I added client_max_body_size 100m; at the end of the #Basic Settings in the http {} section. I hope this answer will help some of you and please tell me if there is any better solution to this problem.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)