How often do you see errors? Constantly? Frequently? Occasionally?
Maybe try removing “valid=300s”? Forcing records to be cached up to 5 minutes longer than intended by the CDN might exacerbate occasional issues. (Though I’d be surprised if it made a big difference – CDNs have to plan around that anyway.)
I’ve been seeing these errors daily for a week or so. This just started up out of nowhere. I’ve been using the SSL certs without issues for sometime now.
I’ll try removing the “valid” off the config and see if that makes any difference.
This issue can be caused by a mandatory access control mechanism (MAC, such as SELinux) that restricts your Nginx process from establishing connections to port 80.
For example, Fedora and RHEL/CentOS come with SELinux enabled by default and there the (counterintuitively named) SELinux boolean httpd_graceful_shutdown controls whether Nginx (or any other web-server) is allowed to connect to port 80.
Since Fedora 27 (and thus RHEL 8 I presume), httpd_graceful_shutdown is disabled, by default. Thus, one has to explicitly enable it (e.g. with setsebool) when OCSP stapling is configured in Nginx.
When it’s disabled on Fedora, Nginx logs subsequent OCSP errors like this:
(with SELinux, there is also a name_connect AVC logged by the system)
Note that my example differs slightly from yours, i.e. different syscall and errno value. Thus, it looks like you are using a different OS with perhaps another MAC security mechanism.