Hi Guys, Wondering if any one can help me host Sup...
# support-questions-legacy
s
Hi Guys, Wondering if any one can help me host Supertokens behind a loadbalancer in AWS. I am getting this error when I try to set it up
r
hey @Sami
Seems like the loadbalance is misconfigured
do you see logs produced by supetokens at all?
when you query it via the loadbalancer
s
No. It seems there is no handshake between LB and Supertokens instance
r
Hmm.
s
I also tried adding NGINX container and proxying the request to Supertokens contianer
getting same error on Nginx too
r
well, there could be several reasons for this issue. Is the supertokens container reachanble without the loadbalancer in front?
s
Yes. I can reach it directly without LB
browser => NGINX => Supertokens But this also does not work
r
is nginx running in a docker image?
s
Yes
r
hmm. I think you would need to give the docker service name instead of 0.0.0.0
s
Tried. Not working
r
hmm. there could be a lot of reasons for this. I need to know more about how you have setup the whole thing. For example, do you use docker-compose? If yes, can i see that?
s
No. I started both the containers separately
r
oh then using supertokens won't work
then you need to give it the IP of your local LAN
using
supertokens:3567
would work if you used docker-compose and added them to the same docker network
s
docker run --name supertokens -p 3567:3567 --env-file -d registry.supertokens.io/supertokens/supertokens-postgresql docker run -p 80:80 --name nginx -v ~/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx
r
you should use the local LAN IP
s
Should I use local lan Ip in nginx?
r
yes
s
Then I am guessing same has to be done with the LB ?
r
i guess.. yea
s
It worked for NGINX
But I guess it wont work for AWS LB
as AWS LB uses instance ID/ Private DNS to route traffic
r
yeaa.. that can be slighlty more complex
s
Is there a way in Supertokens config to get around this?
r
maybe best to ask in aws support
i mean running supertokens with aws LB does work - we do it
I just don't recall what the AWS setting should be
s
ok. Can you share the config of Supertokens for the same?
r
its just running the docker image as usual
nothing special
s
got it
2 Views