Badgateway on Nestjs app
Hi all, I've deployed my nestjs app using Dockerfile and I'm getting bad gateway error. Need help on this
This is my repo https://github.com/lutfifadlan/bookmark. Also i have set the PORT to 8081
18 Replies
You need to either add a PORT variable of 8081 in your Dockerfile (or add it in dokploy), or instead use the default 3333 you defined here : https://github.com/lutfifadlan/bookmark/blob/707622795cfd874e8386ca92c9bb2ce4753093bb/src/main.ts#L19
GitHub
bookmark/src/main.ts at 707622795cfd874e8386ca92c9bb2ce4753093bb ยท...
Contribute to lutfifadlan/bookmark development by creating an account on GitHub.
done that but still getting bad gateway
the dokploy and server logs looks fine
Have you checked the logs of your builds ? the bad gateway is probably because your builds failed

deployment looks fine to me


im getting these logs though on the dokploy. not sure whether its related

damn after I shared those images above, suddenly i got burst brute force for accessing my DB
๐
luckily its just a side project
tried to hit an API from the docker container, it looks good

You're trying to get https certificate on traefik.me route. That usually ends poorly
yeah, but ive tried with just http too and still didnt work
any recommendation to solve the bad gateway error?
ive tried with stop, delete, and then re-create the server too but still didn't work
What does application log say?
no error, looks good to me

Are you deploying it as a docker compose or application?
I'm using Dockerfile, deploying it as application


i have a docker compose file but its just for development purpose

@lutfifadlan I found the issue :
Your app doesn't listen to
0.0.0.0
and listens only to localhost
by default.
I send a PR to your repository : https://github.com/lutfifadlan/bookmark/pull/4GitHub
fix: Bad gateway by listening to
0.0.0.0
interface by Fredkiss3 ...It seems the app listens only to localhost by default, but when using docker, you need to listen to 0.0.0.0, so I added that.
wow it works now! thank you so much
no problem ๐ซก