WordPress on Nginx – Missing admin/toolbar

If you’re using Varnish and you’re not seeing the admin bar it’s because you probably have a rule in /etc/varnish/default.vcl that looks like this:

sub vcl_recv {
    if (!(req.url ~ "wp-(login|admin)")) {
        unset req.http.cookie;
    }
}

That’s going to keep the admin bar from showing up because you’re dropping cookie stuff from all pages except ones that match wp-(login|admin). As a test, try removing this and loading your site. If the admin bar shows up, you will want to adjust your Varnish rules.

There are a few different ways of handling things and it varies. You can check for a specific cookie name, URL strings, etc.