504's, 525's, can't get past some access issues

I've just migrated a whole bunch of stuff to a new server, and the domain to access them goes through Cloudflare. Behind Cloudflare is an Nginx Proxy Manager instance, which has LE certificates configured for each subdomain. My router is configured appropriately to forward all requests on associated ports to the correct destination. I am currently seeing a 504 gateway timeout when requesting one subdomain, but not a different one. Both are configured seemingly identically. My questions are... 1. Is there some sort of issue with LE certs behind CF? I would expect there may be if requests are passing through Cloudflare. 2. Is there anything specific required for subdomain configuration? I've tried adding explicit records for the subdomain, as well as using a wildcard, but neither seems to be overly happy. 3. Is there anything obvious that stands out to someone more experienced than I?
21 Replies
Josh
JoshOP3mo ago
Oh, one more question... If I see the Cloudflare specific 504 error, does that mean that the issue did not propagate at all into my network? It does it hijack potential downstream 504's to display the Cloudflare one? that's good to know, at least... i suspect the problem lies behind CF, but i'm also struggling to find evidence of that wait, no, i am seeing some evidence of that... my access logs show the requests coming in, but it's returning 499's although that's perhaps a weirdness in and of itself, nginx proxy manager is responding with 499 to legitimate requests, and 504 to "trace" requests
2024/12/16 21:41:30 [error] 647#647: *182945 upstream timed out (110: Operation timed out) while connecting to upstream, client: redacted, server: redacted, request: "GET / HTTP/2.0", upstream: "http://10.0.221.13:9000/", host: "redacted", referrer: "http://10.0.0.20:7818/"
2024/12/16 21:41:30 [error] 647#647: *182945 upstream timed out (110: Operation timed out) while connecting to upstream, client: redacted, server: redacted, request: "GET / HTTP/2.0", upstream: "http://10.0.221.13:9000/", host: "redacted", referrer: "http://10.0.0.20:7818/"
it's as if one server can't talk to another :thonk: ok, the machine running the reverse proxy for some reason can't communicate with the machine i'm proxying to
Chaika
Chaika3mo ago
499 is nginx saying Cloudflare closed the connection because Cloudflare gave up/timed out, is most likely the sequence there makes sense
Josh
JoshOP3mo ago
the downside is, i've taken it a bit further, i tweaked some stuff in the proxy manager, and i'm now just getting 521's users are reporting i'm down, too :PepeHands: and now i don't see any requests even hitting my reverse proxy, so something is borked on the CF config side of affairs
Chaika
Chaika3mo ago
make sure your ssl/tls mode is Full (Strict) under SSL/TLS -> Overview
Josh
JoshOP3mo ago
oh, i changed that to full, earlier, to test something else just changed it back though, still 521
Chaika
Chaika3mo ago
ehh Full should still be fine (well, insecure, but wouldn't cause this error), just not Flexible which is sending http/80 to origin
Chaika
Chaika3mo ago
Cloudflare Docs
Troubleshooting Cloudflare 5XX errors · Cloudflare Support docs
When troubleshooting most 5XX errors, the correct course of action is to first contact your hosting provider or site administrator to troubleshoot and gather data.
Chaika
Chaika3mo ago
You said you moved stuff to a new server, where you using CF Before?
Josh
JoshOP3mo ago
I was, yeah the only perceivable difference is the new server makes me wonder if there's some mechanism to reset some CF SSL cache
Chaika
Chaika3mo ago
Well a 521 is just a generic failure to connect, so I would check firewalls/anything you have that could be blocking the connection. You could try going through the front door yourself curl --resolve example.com:443:<ip> https://example.com/ (can replace <ip> with 127.0.0.1 if in shell on same machine as the web server, or remote ip if you don't have a firewall blocking it) might need -k if cert isn't trusted ssl cache?
Josh
JoshOP3mo ago
some cache between cloudflare and my network, whereby it stores the SSL certs and complains if they change before it's refreshed them
Chaika
Chaika3mo ago
connections aren't kept alive for long, and 521 is a failure to establish a connection wouldn't cause that error
Josh
JoshOP3mo ago
oh wait, the proxy manager is now down what is happening in my life, how did it all go so wrong
Chaika
Chaika3mo ago
that would do it lol
Josh
JoshOP3mo ago
the ui has been responsive this whole damned time
Josh
JoshOP3mo ago
i know this isn't your thing at all, but if i don't scream here i can't scream anywhere... why tf does this thing not have an ip address 😭
No description
Josh
JoshOP3mo ago
ok, the proxy manager is back online, only this time, the thing that wasn't working earlier now is working, and the thing that was working earlier is now getting a bad gateway :thonk: @Chaika do you mind me asking if you have some place you're happy to try hit a website? also, if your DMs are open, i'm sort of uncomfortable posting links to my stuff publicly
Chaika
Chaika3mo ago
as long as you mean "hit" as in just try requesting it sure
Josh
JoshOP3mo ago
yah nothing more
Chaika
Chaika3mo ago
so map "works" and pg 502's, probably returned directly from nginx
Josh
JoshOP3mo ago
gotcha, taking a look internally i've a feeling i'm being cached out of the real situation locally, hence asking ok, solved that with the new (old) proxy manager back online for now, i'll try fix everything again in the morning thanks for your help, much appreciated ❤️

Did you find this page helpful?