Custom Domain hosting help
I deployed my Next.js frontend on an AWS EC2 machine at xyz.com, while my backend is still on Convex Cloud. The site was live, but Convex Auth wasn’t working , I couldn’t log in or use authentication flows.
I just need to do a simple thing , deploy my Next.js website on web and use convex DB dashboard as cloud service , no self host needed for me .
How should I proceed , Do i have to buy convex PRO ? whch is 25$ subscription ?
I need to deploy my frontend , I am using nginx inside my EC2 server and SSL using free certbot . Can anyone give me a procedure what should I do .
I am thinking of buying the convex pro and using the above image thing which I found on project setting , will this work ?
I have google auth as well as Password Auth from convex Auth , I have put my .env too which is the development mode .env which is working fine in vercel deployment as well as locally too .
Just need info that we need to buy convex pro or not and if I buy and put this convex site url as let say xyz.com and api as api.xyz.com , will it work automatically like from this convex backend only ? or do i have to chnage my next js .env file too with api.xyz.com


15 Replies
Hi Dev
if it's working on vercel, but not EC2, there are probably some environmental/configuration differences between the vercel hosting environment and the EC2 one
the convex backend doesn't care where your app is hosted
you just need to end up with the right URLs etc in the environment when the app is served to the browser
I think it is returning me null everytime when i try to signup / sign in
to confirm though, it does work on vercel?
yes
got it. I think the challenge we're going to run into here is the question you're asking sounds like what we'll be trying to discover here is what's different between your vercel environment and your EC2 one, since convex does not care where your app is hosted
so this isn't really a convex issue, and unfortunately, our team isn't necessarily experts at hosting web apps in EC2
you're probably using some sort of load balancer there? and maybe cloudfront? I'm not sure. there's a lot that can go on and go wrong. but as long as the served web app has the same environment when the browser loads it as it does from vercel, convex can't tell the difference what hosting provider delivered the next.js app
I am using nginx
I want to use custom domain on frontend , let say xyz.com , will it work ?
for frontend only
yes, there's no reason it can't be set up correctly using nginx
with a custom domain
Ohk , so what does this mean ? like this is only for backend ?

Can we set a meeting of just 5 min plz anyway ?
yes! that's only for backend. not what your users see
this just means the connection URL passed to the convex client in your app is a custom domain name. it doesn't have to do with your website hosting
😢 never been in this kinda issue , deployed more than 20 websites with next js , with websockets too using nginx but 😢
Ok sir , cant waste more of your time , I will redeploy the project again . Hope this works this time
This is the response I am getting , https://cute.mybackends.xyz/signin when i Try to login with google
and with email it is giving me CORS issue


It is giving CORS error direcltly , now i dont understand how to fix this issue , plz help if you can @Jamie .
8|cute | Hit error while running
8|cute | } 8|cute | Returning false from isAuthenticated because Error: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"} 8|cute | at rO.queryInner (.next/server/middleware.js:15:18795) 8|cute | at async rO.query (.next/server/middleware.js:15:18234) 8|cute | at async ib (.next/server/middleware.js:16:27354) 8|cute | at async (.next/server/middleware.js:16:29235) 8|cute | at async async.convexAuth (.next/server/middleware.js:16:28914) 8|cute | at async handler (.next/server/middleware.js:16:29791) 8|cute | at async (.next/server/middleware.js:13:34514) 8|cute | at async e7 (.next/server/middleware.js:13:31295) { 8|cute |
This is the error i am getting . https://github.com/DevItaliya22/org-management-with-pass-wuth
auth:signIn:
8|cute | Error: fetch failed
8|cute | at context.fetch (/home/ec2-user/org-management-with-pass-wuth/node_modules/next/dist/server/web/sandbox/context.js:323:60)
8|cute | at rO.action (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:15:20755)
8|cute | at nS (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:16:4974)
8|cute | at ic (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:16:23665)
8|cute | at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
8|cute | at async async.convexAuth (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:16:28448)
8|cute | at async handler (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:16:29791)
8|cute | at async /home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:13:34514
8|cute | at async e7 (/home/ec2-user/org-management-with-pass-wuth/.next/server/middleware.js:13:31295)
8|cute |8|cute | } 8|cute | Returning false from isAuthenticated because Error: {"code":"NoAuthProvider","message":"No auth provider found matching the given token"} 8|cute | at rO.queryInner (.next/server/middleware.js:15:18795) 8|cute | at async rO.query (.next/server/middleware.js:15:18234) 8|cute | at async ib (.next/server/middleware.js:16:27354) 8|cute | at async (.next/server/middleware.js:16:29235) 8|cute | at async async.convexAuth (.next/server/middleware.js:16:28914) 8|cute | at async handler (.next/server/middleware.js:16:29791) 8|cute | at async (.next/server/middleware.js:13:34514) 8|cute | at async e7 (.next/server/middleware.js:13:31295) { 8|cute |
This is the error i am getting . https://github.com/DevItaliya22/org-management-with-pass-wuth
GitHub
GitHub - DevItaliya22/org-management-with-pass-wuth
Contribute to DevItaliya22/org-management-with-pass-wuth development by creating an account on GitHub.