After adding the same to the remaining 13 virtual hosts, however, Nginx started to complain:
nginx: [warn] "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org" in the certificate "/etc/letsencrypt/live/.../fullchain.pem"
This warning is repeated 4 to 5 times for different domains in different orders.
I've tried to nail this by setting the local DNS on Nginx:
When I restart Nginx twice e.g. with /etc/init.d/nginx restart; /etc/init.d/nginx restart, the second restart issues the warning usually for each and every virtual host!
I've checked whether the local DNS blocked too many resolves by hitting dig ocsp.int-x3.letsencrypt.org 100 times in a row. The first are answered immediately, then a delay of maybe 1 second is added between responses, nothing that should cause the Nginx resolver to trip since the default timeout is 30s.
It probably isn't relevant to this, but you shouldn't set the valid parameter. Let it use the TTL.
What does dig show when it's delayed? A lengthy "Query time"? Or not?
By default, dig's "try the next nameserver" interval is 1 second. It sounds like your resolvers may sometimes be failing to respond in a reasonable time period or at all.
Maybe you should contact the resolver operator and ask if they have rate limits, problems in general, or problems querying zones operated by Akamai or Cloudflare in particular (or Afilias, PCH or the roots).
You might be able to reduce or eliminate the problem by installing a local DNS cache, and maybe switching to a more reliable resolver.
Don't set valid. Let Nginx use the TTL that the CDN put in their DNS records.
And it's not recommended to use a remote DNS server because Nginx's stub resolver isn't securely designed. Though it's unlikely anyone would try to poison your OCSP DNS records, and it's probably not very harmful if they did, since ssl_stapling_verified is on.
Figured it out: Series of dig always blocked after exactly 48 queries, no matter whether I nailed it to one specific or any of the three local DNS. Turns out, the firewall applies the UDP per second limit for both incoming and outgoing. Increasing the burst rate a little fixes the issue.
However, this is more of a workaround than an actual fix.
A local DNS cache would certainly help, but appears to be an overkill and last time I had such a cache installed on a server, it failed quite often. And why add another cache, isn't Nginx already caching the lookups?
By default, nginx caches answers using the TTL value of a response. An optional valid parameter allows overriding it:
Even with the custom 30s, shouldn't the nameservers be hit exactly once instread of apparently close to 60 times?