Pointed domain to VPS IP & changed both name servers but website is still reporting bad gateway?

Is there a reason my site is reporting the bad gateway 502 error? SSL and browser is fine. Could this be due to the fact that I just created this domain about 6 hours ago? domain is korycommunications.com
19 Replies
Chaika
Chaikaā€¢13mo ago
Is there a reason my site is reporting the bad gateway 502 error?
There is definitely a reason
Could this be due to the fact that I just created this domain about 6 hours ago?
That wouldn't be it You can check out the community quick fix tips here: https://community.cloudflare.com/t/community-tip-fixing-error-502-504-bad-gateway/44008 Otherwise I would ask: Are you using a reverse proxy such as nginx or apache, or CF Tunnels? Most likely that error is coming from that service and Cloudflare just proxies it/brands those pages nicely. You could disable proxy to eliminate Cloudflare being the issue if you think they are.
Cloudflare Community
Community Tip - Fixing Error 502 / 504: Bad Gateway
Error Try the suggestions in this Community Tip to help you fix Error 502 / Error 504: Bad Gateway / Gateway Timeout. Background The 502 / 504 errors are quite similar. Generally, a HTTP 502 / 504 errors occurs because your origin server (e.g., your web host) is returning this code to us, and Cloudflare returns this code in turn to your visit...
uid1
uid1OPā€¢13mo ago
I can't find out why yeha I tried disabling proxies from cloud flare for both dms records dns wait could it be because i got a reverse proxy going for hostinger?? I have a vps in hostinger in the cloud panel it says add site and it gives multiple options one of which is a reverse proxy and my domain is linked to it I thought a reverse proxy was necessary though basically when I did this it said the site wasn't secure and wouldn't load the page i'll try disabling the hostinger RP
Are you using a reverse proxy such as nginx or apache, or CF Tunnels?
just saw that my vps also has a nginx reverse proxy so I basically have 2 RP's
Chaika
Chaikaā€¢13mo ago
Not necessary unless you don't have a unique IP just for your VPS/the service Either could be giving the bad gateway
uid1
uid1OPā€¢13mo ago
yeah I deleted the hostinger RP but I don't think I can disable NGINX
No description
uid1
uid1OPā€¢13mo ago
I read a few other posts and some people had the 502 because they had HTTPS always on enabled
Chaika
Chaikaā€¢13mo ago
it's probably necessary if you're using it with php for a wordpress site or something
uid1
uid1OPā€¢13mo ago
I tried disabling that and it didn't fix it either just gave more problems
Chaika
Chaikaā€¢13mo ago
it looks like you're missing an ssl cert on your origin web server (hostinger) as well
uid1
uid1OPā€¢13mo ago
no I don't have any sites set up in my VPS though i'm basically trying to integrate a platform
uid1
uid1OPā€¢13mo ago
this is what I mean
No description
uid1
uid1OPā€¢13mo ago
I had RP selected weird I could've sworn last time I checked it said SSL was good wait wth lol so it was the server the entire time
Chaika
Chaikaā€¢13mo ago
You might have been looking at CF's SSL. Want to make sure your SSL/TLS Mode (under SSL/TLS -> Overview) is Full (Strict) as well, otherwise Cf is connecting insecurely
uid1
uid1OPā€¢13mo ago
yeah that's probably what I was seeing sorry dude quick question though I heard from a few posts that SSL/TLS mode full isn't always good since it might cause issues. is this true? that's why I only had it on Full
Chaika
Chaikaā€¢13mo ago
You always want to use Full (Strict), it's the essentially same security checks that a browser normally does on a certificate. Full doesn't validate if the ssl cert is issued by a trusted root or non-expired (which means someone could MITM the connection and serve any certificate, and CF would accept it)
uid1
uid1OPā€¢13mo ago
full strict* oh
Chaika
Chaikaā€¢13mo ago
no worries, The easiest way to troubleshoot this is probably going to be to keep proxy disabled (to remove CF from the mix) and get it working with valid ssl and such, and then turn Cloudflare proxy on. Might get some better errors as well
uid1
uid1OPā€¢13mo ago
that makes sense actually yeah there's no option for it in the cloud panel wouldn't the full strict mode suffice since it would check if the origin server has a valid cert?
Chaika
Chaikaā€¢13mo ago
Those two statements conflict with each other "I don't think I can add an ssl cert on my origin...wouldn't full strict work because it would check if my origin has a valid cert" I'm sure you can somewhere though, just gotta find it. CF under SSL -> Origin Certs will give you an cert for your origin (only trusted by Cloudflare) which lasts up to 15 years. Again though, only works with proxy enabled/trusted by CF
uid1
uid1OPā€¢13mo ago
sorry I just found that out a few minutes ago lol didn't mean to waste your time but it ended up working you can see it for yourself thank you so much dude I swear I thought this issue was about my vps being down or something lol šŸ™ i'm kind of new to this and the information you provided really helped me understand more
Want results from more Discord servers?
Add your server