My site returning 502 bad gateway

My website was active on cloudfare last month, but recently it stops without any specific reason.
It displayed an error about my nameservers been change from cloudfare, wish wasn’t changed by me, no one have access to my hosting provider.
I changed it back to cloudfare nameservers and it became active on cloudfare, ever since then it is not opening it keep returning 502 bad gateway.

Please I need help, my visitors are complaining for 2 days now.
Here it’s

1 Like

That 502 is caused by something on your server.

However, I’m getting an infinite redirect loop when trying to visit I’m getting a 301 that redirects me to, which is what I was trying to visit in the first place.

Do you have a Forwarding Page Rule set up here, or a redirect in your .htaccess?

1 Like

Thanks for your reply.
I contacted my hosting provider recently, they requested for my cloudfare login details.
Few minutes later they said they have correct the DNS settings (that is when it started displaying error too many redirects) they said I should wait for 12hrs or more.
It’s more than 12hrs now no positive effect.

DNS settings should only take 5 minutes.

I have a second idea: Check the SSL/TLS app here. SSL is probably set for Flexible (yes?). Try setting it to Full, or Full/Strict.


Thank you very much, it solve the problem.
But right now the loading time has greatly increased from 1-2seconds to 6-10seconds what might be the problem?
And why isn’t the site working anymore on SSL flexible?

Flexible means Cloudflare is trying to get your content with HTTP. But your server is telling all visitors to use HTTPS. But Cloudflare is using Flexible, which wants HTTP. So they keep going back and forth arguing.

Full means Cloudflare will use HTTPS, which is what your server wants. Full is better because it’s a secure connection all the way to your server.

There are only a couple of slowdowns on your site. For some reason, the initial call to your home page takes over a second. I see you’re using WP-Rocket. Hopefully it can be configured to deliver your home page HTML quicker.

1 Like

I agree with sdsayman,
try adjusting SSL from Flexible to Strict, and maybe try Off
to see if that generates a new error message.

Newer error messages are useful because it’s a different message and you are making progress in a sense. Sorting to find the source.

Consider, backing up then delete your root Htaccess file to rule out that being the source of too many redirects.

The reason I suggest that when I view the domain redirects want to include WWW in your address which can be the source of conflicting rewrite rules. Also, I see you are using Wordpress that could mean subdomain rewrite conflicts.

Cloudflare browser extension Claire
Ray ID

The good news you’re connecting with Cloudflare or Claire
wouldn’t display the above trace information.

Take a look at this performance report:

There’s a bg3.png/ that redirects to /1 That should be fixed somehow.

There’s an mp3 file that doesn’t successfully load. It could just be an encoding issue, where it’s encoded for streaming. I’m not a media expert, so I’m just guessing here.

And for some reason I don’t understand, it loads itself again at the very end…as an image.

Thanks for the replies.
The bg3.png/ redirect was initially displaying Error 404! Page not found! when I tested it with gtmetrix, have been trying to delete the url or change it directly but am unable to locate it, I even tried finding it through inspect elements to no avail , i then redirect it to homepage with a redirect Plugin.
And also i have no MP3 or playable media file in the website. I don’t just know how to locate this errors tho I haven’t encountered the MP3 ish when tested with Gtmetrix.
the SSL been set to full/strict doesn’t have negative effects on website load time?

Those mp3 files look to be loaded by the WP Recall plugin for its chat feature. Maybe there’s an option to turn off chat sounds.

That bg3 file is supposed to be a background image for your site. Maybe it’s a setting in your WordPress Appearance -> Customize section. If you can’t track it down, then I suggest you redirect it to a harmless resource. Maybe even a 1x1 transparent PNG file you can create and upload.

Speaking of redirects, maybe that’s the cause of the mysterious site reloading as an image at the end of the waterfall view. This may be the time to deactivate the Redirect plugin and troubleshoot the 404 problem.

SSL on its own doesn’t add a significant amount of time to resource loading. The waterfall view of the page load shows this isn’t the case. The yellow bar section is the browser waiting for the file from the server once the SSL connection and file request have been completed.

Thanks for the clarification.
Still can’t find the bg3.png file, maybe it’s because am not that familiar with WordPress…
But as at last month the file didn’t have this great negative impact in the website load time, the maximum load time was 2-3seconds.
About to deactivate each Plugin one by one including the wp-recall and see if there will be changes.

Loading the same page again as an image normally means there’s an image with a missing url (e.g. ) somewhere on the page.

Can happen when some property/variable hasn’t been set.

I believe the “Page-as-image” problem is because the OP set a redirect for a missing to point to the page itself.

Ah good spot - that’s another common cause.

A post was split to a new topic: 502 here is ray id

2 posts were split to a new topic: 502 errors

A post was split to a new topic: 502 issues

A post was merged into an existing topic: 502 here is ray id