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
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...
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
Not necessary unless you don't have a unique IP just for your VPS/the service
Either could be giving the bad gateway
yeah I deleted the hostinger RP but I don't think I can disable NGINX
I read a few other posts and some people had the 502 because they had HTTPS always on enabled
it's probably necessary if you're using it with php for a wordpress site or something
I tried disabling that and it didn't fix it either just gave more problems
it looks like you're missing an ssl cert on your origin web server (hostinger) as well
no I don't have any sites set up in my VPS though
i'm basically trying to integrate a platform
this is what I mean
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
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
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
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)
full strict*
oh
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
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?
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
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