WordPress on Nginx - Missing admin/toolbar

Hi I've been trying to figure this out for quite some time now, but whatever I do nothing seem to work. I have a VPS setup running Nginx + Varnish with WordPress multisite. Everything works fine except the admin/toolbar when browsing the sites. It simply wont load. It loads in the admin area, but when viewing site it doesn't load. I have checked the "Show Toolbar when viewing site", and I have deactivated all plugins. Now I have even gone …
Category: Web

Wordpress mobile version is not responsive anymore after installing varnish

# Default backend definition. Set this to point to your content server. backend default { .host = "127.0.0.1"; .port = "8080"; } sub vcl_recv { # Set the X-Forwarded-For header so the backend can see the original # IP address. If one is already set by an upstream proxy, we'll just re-use that. #return(pass); if (req.method == "PURGE") { return (purge); } if (req.method == "XCGFULLBAN") { ban("req.http.host ~ .*"); return (synth(200, "Full cache cleared")); } if (req.http.X-Requested-With == "XMLHttpRequest") …
Category: Web

dynamic page not displaying correctly when Varnish hosting ignores query string parameters

I have a WP site with managed hosting that uses Varnish. I have a landing page that displays the appropriate images based on a couple arguments passed through the query string. So for example, depending on where the user is requesting this page from, the URL might be www.example.com/landing?v=1 or www.example.com/landing?v=2... and each of those pages would contain a different logo image that is determined by the value of v in the query string. It seems that the default behavior …
Category: Web

Why does WP HTTP API switch the method (POST/PURGE) to GET when redirecting (302)?

I discovered after much painful debugging that requests to the the WP HTTP API (in this case, though wp_remote_request()) always ended up as GET method after being redirected, even if the method was something else in the initial request (in my case PURGE as used by the Varnish HTTP Purge plugin) Normally this would apply to POST requests, where redirecting to a GET request of the same URL means completely obliterating the data being sent with the POST. In my …
Category: Web

Wordpress varnish pages printed twice

We have installed varnish on our server today to speed up our webshop. And it is very effective. We use W3 Total Cache configured with MaxCDN and Redis to manage the cache in WordPress. But some pages on our shop now are printed twice in the browser (in the source it contains 2 tags) and all scripts are loaded twice, which slows down the site on that pages. Has anybody experience with this problem, or an idea how to solve …
Category: Web

Varnish with Wordpress

I have moved my Wordpress site (a small blog) onto a hosting platform with Varnish at its front. Varnish, rightly, won't cache when cookies exist. It looks like Wordpress starts the session, even if it doesn't need it. As such, it sets the PHPSESSID cookie, even though a var_dump() of $_SESSION is empty (when done at the end of index.php). Is there a way to stop Wordpress doing this? Perhaps with an existing or, indeed, custom plugin? EDIT: Looking at …
Category: Web

Separating HTTP and HTTPS content with WordPress, Varnish, and an SSL terminator?

Background: I host a WordPress site with a hosting company that places a combined Varnish server + SSL terminator system upstream of my web server. The WordPress site runs on Apache and is accessible over both HTTP and HTTPS via the Varnish+SSL terminator. The setup looks like this: Image credit: DigitalOcean (For reference, DigitalOcean is not my host but their image precisely describes the setup at my host.) I do not have administrative access to the Varnish+SSL system. All the …
Category: Web

Wordpress + SSL + Varnish + Pound

Hello Im try install a SSL certificate with Pound and Varnish for a Wordpress site. The Proxy is an independent server, and has been running fine (few years) with varnish. I've used pound and this setup (90% the same) on many custom sites, so am sure the configuration there is correct and the SSL certificate is valid also. Setup = http+https -> Proxy (Varnish / Pound (Certificate)->Varnish) -> Webserver the https call works before I try and rename the site …
Category: Web

Varnish + Nginx for Wordpress is Good?

i m instaling my new server and trying make some good environment for my wordpress so i wanna know if installing Varnish + Nginx is good idea and will speed up my wordpress website or there is other Combos that work better and if there is any known trouble between with varnish and wordpress Thanks for help
Category: Web

Popular posts with Varnish ESI

I am trying to get Varnish ESI to work with displaying the most viewed posts on a new blog I am working on. Here is my current script; In theme file: <esi:remove> <?php get_template_part( 'partials/homepage/most-popular-loop' ); ?> </esi:remove> <!--esi <esi:include src="/lib/plugins/esihandler.php"/> --> To call the popular posts: function wpb_set_post_views($postID) { $count_key = 'wpb_post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } //To keep the count accurate, lets …
Category: Web

Why would changing ports from 80 to 8080 cause wordpress to act unexpectedly?

I am trying to setup Varnish, which requires Apache to listen on another port that's not 80, so I chose 8080. However, Wordpress is working very unexpectedly. The index page shows, but it's broken, and all css, js, and other assets show 404 errors. This seems very different than what happens with other sites such as Drupal or even static pages where all links and assets automatically default to the 8080 port number. Why would Wordpress not follow these standards? …
Category: Web

Prevent Wordpress from sending Cache-control http header

My site sits on a server that uses Varnish as a (powerful) caching engine. Unfortunately, it seems wordpress is busting the Varnish cache by sending a cache-control http header. If I curl -I domain.com I get: HTTP/1.1 200 OK Server: Apache/2.4.10 X-Powered-By: PHP/5.4.4-14+deb7u14 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=e00738aoughg407ljm270kj0l6; path=/ Content-Type: text/html; charset=UTF-8 Accept-Ranges: bytes Date: Fri, 31 Oct 2014 21:44:16 GMT Connection: keep-alive Via: 1.1 varnish Age: 0 …
Category: Web

Nginx + WordPress + HHVM: Why isn't Batcache working? Would Varnish help even more?

I've heard great things about HHVM, so I've setup a copy of WordPress blog (on another domain) with Nginx (with the Pagespeed module) and HHVM. Right now the benefits are obvious: on the same config, load times are between two and three times faster. I'm trying to speed up things a little bit, and I've also installed Memcached and Batcache. I've installed the memcached package, copied object-cache.php (Pastebin) onto the root folder of the WordPress blog, and after that I've …
Category: Web

Large Woocommerce Site (83,000 items), What Can I Do?

So I have a really large woocommerce site (partsboss.co) that has around 83,000 items. It's on VPS hosting with digitalocean, and things were running super fast until around 50,000 items. Now the site is just draaaaaaaaaging. It's set up on Ubuntu with nginx, APC and Varnish caching. I'm not really sure where the bottle neck is or how to fix it, but as far as I can tell it's basically taking forever to query the mysql database and return results. …
Category: Web

How can I use Varnish Edge Side includes for a sidebar?

I've read this post here but am unsure where to start. https://www.varnish-cache.org/trac/wiki/ESIfeatures Edit for clarification: I do want to use Full page caching but once we cache say the article page, it can stay in the cache for a day or so, or if something pushes it out. But I'd Want the sidebar to refresh at a faster rate
Category: Web

Varnish + W3 Total Page Cache

I currently have varnish setup on my server. I'm also using the W3 Total Cache plugin to speed up the site through a CDN. Question: Is there any point in using varnish if the pages are being cached and severed through the CDN? (Does this make varnish redundant).
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.