504 Error even though the server is fully functional

I experience a 504 Gateway time-out error every time I try to access my site at https://dajana.tk.

The site was fully functional through the freenom nameservers and by simply using the IP address but since I’ve changed the nameservers to the Cloudflare nameservers I’ve experienced this error.

Is there any solution to this or do I simply have to wait? It has been like this for I think 12+ hours.

That 504 comes straight from your server

image

Also, your server certificate only covers your naked domain and another domain, not your www record though. Assuming you want to access it via “www” too you couldn’t have a properly secured connection. You should fix this as well.

Hmm the 504 seemed to really have been an issue with my server, I’ve changed some more things and set it back to the cloudflare nameserver and I also activated a Origin CA certificate.

I will get back to you as soon as the dns updated.

I am now getting a dns lookup error… The server was definitely running on the freenom servers.

Could this be because of some setting I didn’t configure right in the DNS settings of cloudflare?

You now have pointed your domain away from Cloudflare. That’s a whole different error and not Cloudflare related any more.

It’s not pointed away though

or am I missing something?

According to the registry it is

nslookup -type=ns dajana.tk a.ns.tk
Server:  UnKnown
Address:  194.0.38.1

dajana.tk       nameserver = ns01.freenom.com
dajana.tk       nameserver = ns02.freenom.com
dajana.tk       nameserver = ns03.freenom.com
dajana.tk       nameserver = ns04.freenom.com

You need to clarify this with your registrar.

oh that’s really odd thank you for telling me I’ll look into it!

The nameservers are now set to the cloudflare servers and I’m back at square one experiencing the 504 Gateway time-out. I know you said that it must be something with my server but since it did work on the freenom NS and then stopped working when I switched to the cloudflare server I’m unsure what to think of that.

Could this be because of my nginx config and if so are there any specific settings I would have to apply for it to work? I don’t see anything else in between that could cause an issue especially cause it did work while I was testing it on the freenom NS yesterday, in between it didn’t work cause freenom had already cleared my dns but was still switching the nameservers.

It could be a number of reasons. You need to check your server logs to find out why your server is returning that error. Maybe your server is proxying back to your domain, which - now on Cloudflare - would go in circles. I am afraid that’s really just a server-side issue.

2 Likes

all right, thank you so much for all of the help! I’ll try to find anything that could be the reason!

Hello, I have similar problem. I was able to re-produce it as well.

Case and the problem;
I have mysite working(mysite.tk). Domain from Freenom. NS from Freenom. I have an Nginx container listening on 443 for the backend to respond. Then I move the DNS to Cloudflare and site continues to work. So far so good.

Then I shutdown nginx and restart it.

Then Error 504 screen gateway timeout;
But, I check and find that;
Nginx is working and responding to ip:port since I can see the responses in the log but not to mysite.tk since there are no logs either. I checked nginx logs and backend logs and could not find any record.

Then I take mysite.tk out of Cloudflare and update NSs in freenom and wait for DNS resolutions. Then again;

Then this time is says 504 Gateway Time-out/nginx;
But, I check and find that;
Nginx is working and responding to ip:port since I can see the responses in the log but not to mysite.tk since there are no logs either. I checked nginx logs and backend logs and could not find any record.

Then I shutdown nginx and restart it.

Then mysite comes back and starts working and add the site to Cloudflare and go to square 1.

I have also found an explanation from hostinger.com that this 504 is not related to the server.

Any suggestions to the problem?

Thanks a lot in advance

It’s the server.

If it doesn’t work with Cloudflare not involved and a restart of the server fixes it that seems to pretty clearly demonstrate it’s the server and not Cloudflare.

Hello and thanks a lot for quick feedback.

I see that the case I have written was not complete.

When the site is out of Cloudflare and nginx is shutdown and restart, the site continues to work as expected.

This particular problem occurs after the site is added into Cloudflare and ngxinx is shutdown and restarted.

Any feedback is welcome

Thanks again

Hi,
We have found the problem on our side and fixed it. It was the nginx container server directive issue.

Thank you