Wordpress+nginx-proxy docker + letsencrypt = 5xx Errors only when Cloudflare proxy is enabled. Working otherwise


#1

Hello,

I have a (supposedly) fully working Wordpress website with Docker using nginx-proxy and letsencrypt through https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion. The LE certificate is correctly issued and works. The domain is on CloudFlare. I am using Full (strict) SSL.

Here is my issue:

  • If under DNS, I disable CloudFlare HTTP Proxy (CDN) [grey cloud], everything works fine. Site is accessible, I see LE valid SSL, all is quick and snappy.
  • If under DNS, I enable CloudFlare HTTP Proxy (CDN) [orange cloud], my website starts alternating between Error 504 Gateway Time-Out, Error 520 unknown, generic Error 500, and (very slowly and infrequently) displaying a web page from my website.

Anybody could help? Thanks!


#2

I fixed the issue. something (still can’t figure what) of my server settings and/or CloudFlare was making dozens of requests per second to a file (my website logo, actually). The request was for a file that was not existing (404). My server was basically DOSing itself. I still do not know what caused it and why it happened, but putting the logo under the requested URL stopped the issue completely. As always: check logs carefully!