Cloudflare load balancing between regions
I'm trying to setup a cloudflare loadbalancer to route traffic by location between different services on Railway (EU and US-West).
I'm having some problems configuring it, I'de really appreciate any help!!
197 Replies
Project ID:
dd3f96f7-3ab3-4453-86a3-32328b2f81d6
dd3f96f7-3ab3-4453-86a3-32328b2f81d6
When I try resolve the root domain I get:
so I have the load balancer setup now, and it thinks the origin servers are healthy
Feels like it might be a TLS error
I occasionally see this page
then this page
railway uses the host to know what service to route traffic to, so it sees wikid.app and doesn't know where to send it to, somehow you'd need to get cloudflare to set the host to whatever origin it decides to proxy to
brody!! thankyou
so this is the little bit confusing thing
let me show you
in the load balancer, it is configured for the domain
wikid.app
it has two origins configured, one for eu, one for us
I tried configuring it for railway generated domains, and it seems to kinda work
I don't even know if what I said is possible in cloudflare, I only know thats why it doesn't work
yeah..
it's strange
it seems like the service in railway needs to be configured to respond to wikid.app
but this shouldn't be needed
since cloudflare should be responsible for the routing to services
I have only ever seen a host mask option with fastly
and that was not with a load balancer
is it possible to ask the team on monday if this is possible with railway?
cloudflare load balancing across regions
it is possible, one way or another, they even mention it in the docs
sweet
ok that's promising
that also means you'd need to provide your own certs for wikid.app, since railway isn't in charge of that domain anymore
i see, i believe cloudflare can also do this right?
I honestly don't know
i know i'm kinda poking at the extremes of what's possible here with railway
but it would be so nice to have eu / us regions working
haha no you're not, if cloudflare has a way to issue a cert for your domain and set the host to the upstream domain then you'd be done by now
to install on your server is not applicable here
yeah >.< that's what's confusing, i thought cloudflare was already sorta doing this
1. railway isn't your server
2. cloudflare is the server now that they're doing the lb
right exactly
but i just need to route traffic to railway
the load balancer i think normally takes an IP or a hostname
but it doesn't seem like railway router supports this setup
it doesn't know how to handle it
try with Fastly, they let you set conditions and you also should be able to set the host
damn, i'd like to try get it to work with cloudflare since I'm using alot of their products. It's also not clear to me if fastly would work either
well keep messing around with cloudflare then, but with fastly you can write your own logic
i can't see how that's different to cloudflare
can you write logic like that in cloudflare?
i could show you in VC maybe?
I don't like VC
ahh i remember lol
but you now know your two blockers, so play around some
damn, well. idk honestly. I'm lost on that
try to solve it the same way I would, google stuff and run around in the cloudflare dashboard
fair. I'll give it another shot. Although, I personally think the things I have tried, leads me to believe this isn't possible yet
the clue for me this this bit:
configuring the domain wikid.app in railway shouldn't be required
I'm not sure if I'd even be able to test something like this, I don't subscribe to any vpn services so that I could switch regions
but it seems like it is
currently i'm seeing all the traffic routed to US servers
to get an ssl cert it's required, but like I said you need to provide your own cert since railway is no longer going to be the one routing traffic
railway is not going to have anything to do with the root domain wikid.app for what you want
no 😦
i don't think fastly or cloudflare can help
it's a limitation of railway router
you're giving up too easily and worst of all you're blaming railway
just found this null lmao
but mac, there has to be a way
even if its slightly janky lma
^.^
someone give me their login to a vpn provider already
Don't lose HOPE!
proton has a free vpn
i use tunnelbear for free
for sus things
hehe
the free 2 gigs are enough
(monthly)
gross
but you don't need a vpn for this lol 😄
?
oh fuck i just realized what you thought
i don't mean stuff like porn
ahaha
with sus things
like... netflix
how would I test region routing if I can't make a request from a different region
i mean like tryna get access to bard while being in spain and under 18 kinda sus things
at least in cloudflare you can set the proximity via a map:
you could drag this map and route all US traffic to the EU origin lol
if you wanted
i can one hundred percent see a company accidentally running like that and not noticing
hehe
yeah... !
boss, our latency just jumped 200%! no idea why...
lmfao fr
that's not how you'd have it actually setup in the end so I wouldn't do that myself
fair
proton vpn is pretty solid
and free
is their free version gonna ask me to upgrade every minute
nope
i've used it for years, never paid
can I put a subdomain in cloudflare without having to setup the nameservers
i beleive for cloudflare to work, you need to configure the name servers so cloudflare can proxy requests right?
on wikid.app that was the first step I needed to do for configuring cloudflare
so if i wanted to test region lb with cloudflare id need another domain, i only own one and im not changing the nameservers on it
i can let you test a domain
oof. I mean you're welcome to play around with my cloudflare account
just bought it yesterday
and i have no use for it whatsoever
(for now)
is it a sus domain
israsist
.com
me omw to check mod log to see if you said something worse before you said that
LOL
anyways no rush on this 😒 it's about to be christmas, and it's your birthday brody lol... i wasn't expecting this to be solved today tbh
nope, omnibot.es
i think
what are its current nameservers
or was it .com...
i have no idea
just bought it
and it is .es
should be nominalia's ones
why is there an ftp subdomain lmfao
@Brody
hmmm now could i just add that to my cloudflare account?
hold up lemme get brodyiscool.online
and give that to you xd
bc i will use this one this xmas
lmao dont go buying a domain for this
its free for me
like a weird offer
but if you promise to give it back after youre done
you can use that one
i mean ofc but i think id only be giving you nameservers to set on it, we arent doing a domain transfer
i have a domain we can do that on
wilko.dev
oh if its only that we can do it
or even better on mac's one
whichever one you choose :)
ty lacrak, you're awesome buddy
send me NS
you mean that to brody right?
btw please don't take this to DMs, i wanna see how this is done
incase i do need to use railway for something like this one day
ill go with mac's domain
getting ns now
ok
very interesting nameservers
should be done!
actually if you point 2 domains to the exact same nameservers they just act as one right?
or does the ssl cert freak out...
no clue
not impressed
LMAO
no way
how comes mine is free then?
tunnelbear is still free
mine is free, it just wants me to upgrade
ahh
and i haven't noticed any push to upgrade
did you just leak your ip lmao
eh
just replug router
its fine :)
if this works
nah just press the renew button in your routers settings
i bet you wikid app will have the fastest api, on railway
no joke
(inb4 2940ms latency)
hehe
(i'm joking dw)
i mean if i end up working with you that would become my problem lmfoa
brody i can send you my CF credentials if that helps
you won't have a load balancer without $15 >.<
no i think the nameservers are sufficent, im just setting up the two region services right now
i see ok
oh, then yeah id need the creds if it isnt on free
right, one sec, will DM you those
can i have em too 😳
ive removed wilko.dev from my account, go ahead and add that to your own cloudflare account
context: i now have access to his account
sweet
you should see wikid.app then goto Traffic I think on the left
and it comes with dark mode on, how thoughtfull
there's a section for Argo and Load balancers
erm
ooo
you need access to anythign else?
haha no, i have pro, it was just missing with the new ui
oh lol
im going to get the basics working before i touch wikid.app
alright 🙂 🤞
oh for me to add wilko.dev youd need to pay again lol
just fiddle with wikid app 😄
doesnt matter if i mess something up?
nobody's gonna mind if it goes down
nah, it's a toy project atm, not even released yet
i've removed wikid.app domain from my Railway project
ill just be digging around the ui for a bit
no worries
you can get lost in cloudflare lol
so many settings
starting to feel like AWS console
proton not gonna work, need something else
unless its just the chrome extension
hmm
maybe I can hit the end point for you?
i'm in europe
where should i visit?
ooo
is it working?
visit from singapore
wikid.app is resolving to a EU railway
from my location
that's ... promising !!
ok
its the fallback pool so dont get excited
i will goto singapore one sec
wow
i think you did it
AS
and you where ready to give up lol
O.O
how tf
did you do that
im built diff
yeah.
please explain what you did lol
well you see... i took my own advice
O.O
idk personally I think you're just pretty good at the networking stuff
it's not my skill, i'm happy to own that lol
most literally, exactly what i said
lmao nice
oo
its the host header?
ay
honestly i would of never guessed that
not in a million years
he did tell you tho lmfao
was right from the very start
also.. i'm bad at reading
argh
i see >.< yeah... mb
can i play around with cloudflare now brody? ;-D i wanna configure wikids regions for it
go for it
service groups is perfect for this kind of thing
ooo
i'm gonna try it!!
man it's not obvious how to enable that
trying to figure that out
lol
This entire thread made into a portfolio blog post would be super cool
nice tutorial here
maybe
^.^
could be... something cool
how do you like group them together with the coloured background?
i can move them around but i can't seem to colour them
right click on the service
ooo
got it
damn
or just on the canvas, I forgot
bro
ok i just need to get the planetscale database hooked up
ay that looks nice as hell
how expensive is it to run tho 💀
can't be cheap at all
i think must be about $100/m i think
database / cloudflare / railway
DAMn
imo that's fairly priced considering all that infra
yeah
totally
i'm not complaining
i think most of the bill is on cloudflare stuff tbh
thank you for the trains!!! ❤️
you deserve way more.
awe thank you
Brody helping other people on his birthday 😭 You're the best!
yeah and I'll be here on Christmas too
You're too good to us 😩
i will also be snoopin in here lmao