Next.js Discord

Discord Forum

Deployment region Vercel

Answered
American Shorthair posted this in #help-forum
Open in Discord
Avatar
American ShorthairOP
Does anyone know and is it possible to deploy the app to vercel EU server. I know functions can be deployed in Europe but every build I make is deployed in US east Cleveland. I need it to be in Europe since my backedn server is in EU.
Answered by American Shorthair
The anawer I got from Vercel team is that i can use static IP adress and choose regions for the deployed app or site only if I subscribe to enterprise plan 😦 @Asian black bear @risky @Asian paper wasp thank you all for your help.
View full answer

69 Replies

Avatar
Asian black bear
The CI/CD builds are always done in the us-east-ohio region, but they may be deployed elsewhere. You can configure it in the Vercel portal.
Avatar
risky
i can't agree with your "us-east-ohio" for build... (note sfo1 it is the same place as serverless is set for)
Image
Avatar
Asian black bear
Oh then my functions are deploying to the wrong place as well 😡
Avatar
Asian paper wasp
I think the static part is cached in CDN which is distributed around the globe, while the dynamic part (which are serverless functions) follows the serverless function config
Avatar
American ShorthairOP
The anawer I got from Vercel team is that i can use static IP adress and choose regions for the deployed app or site only if I subscribe to enterprise plan 😦 @Asian black bear @risky @Asian paper wasp thank you all for your help.
Answer
Avatar
Asian black bear
I am planning to contact them because that is contrary to their sales sheets and documentation

Changing your Serverless Function region
All Vercel accounts can change the default region of their Serverless Functions. Learn how to change the region in our documentation.

https://vercel.com/guides/choosing-deployment-regions

They mention static ips and multi-region function deployments for enterprise, but that is not what we are asking for. I will let you know if I do any better! All of my data is in us-west-2 !!!
Avatar
risky
I'm confused what the issue is... My build is the same as function location, is your different?
Avatar
Asian black bear
My build is ohio and my function location is supposed to be portland. If what you say is true, my functions are in the wrong place
I had assumed they just did builds in some default and pushed them to other regions
But yeah... idk i would need to test it now
Avatar
risky
I'll check my other ones and see if they are randomly assigned
It's follows the function location for me (even with project in Washington)
There is a chance they don't have a build there, so it has do to the closest one (idk USA geographicy)
Avatar
American ShorthairOP
@risky I think you are right. I will have to try to find another option for Nextjs project deployment. Enterprise plan is tooo expensive to use it for my purpose.
Avatar
Asian black bear
it is not random, it is just always saying the build is in Ohio
Avatar
Asian black bear
after a bit more investigation, I have concluded that my build and SSR take place in the clevland (us-east-2) AWS region. Using a route.ts like this:
export async function GET(request: NextRequest) {

  const message = await fetch("https://checkip.amazonaws.com/");
  let comment = await message.text();

  return new NextResponse(`${comment} ${process.env.AWS_REGION}`, {
    status: 200,
    headers: { "Content-Type": "text/plain" },
  });  
}
Avatar
risky
so, the thing it says at the top of logs isn't accurate?
Avatar
Asian black bear
When the page was output as "static" (ie. all data fetched at build) the IP was in this range, and the region variable was not set. This matches the build log message Running build in Cleveland, USA (East) – cle1 (FYI: cle1 is Vercel-talk for us-east-2)
    {
      "ip_prefix": "18.191.0.0/16",
      "region": "us-east-2",
      "service": "EC2",
      "network_border_group": "us-east-2"
    },

This is unfortunate, because at build time significant amounts of data might be fetched from a database which might be in a different region. Yuck.
Avatar
risky
and the issue of OP where it has to be in Europe 😭
Avatar
Asian black bear
On the plus side, by forcing the build to output a lambda instead of a static by export const dynamic = "force-dynamic"; I was able to find that the Lambda was in fact deployed to us-west-2 because the environment variable was set!
I mean, it matches my original thought that the lambdas actually were pushed to the right place
Avatar
risky
phew, they are aren't wrong with docs, just for built it is a little weird
Avatar
Asian black bear
but yeah, if Vercel is saying being GDPR data residency compliant requires anything "enterprise", that is kind of a joke
Avatar
risky
well ig to use vercel, you need to somehow build youself (in eu) and deploy to vercel without it needing to do any building
but npx vercel --production still uses their building system, so idk how to build by self - and if its worth using with the trickery
Avatar
Asian black bear
yeah idk, you can also argue that the database establishes residence, not where the front end is built
just as long as you aren't statically building in customer info
it is a little fuzzy though, I certainly would just host next somewhere else
Avatar
risky
Avatar
Asian black bear
netlify, cloudflare, even next start bascially anywhere
Avatar
joulev
vercel build and vercel deploy --prebuilt
Avatar
risky
(but they don't have the same degree of pnp functions as vercek includes by default)
ahh that could be an option then 🙂 - i wasn't sure if there was a prebuilt option
Avatar
Asian black bear
You could still do CI/CD in GitHub actions pretty easily too, but the question begged is... why?
does Vercel not care about companies doing business in the EU?
Avatar
risky
and there isn't any downsides of this other than no vercel build cache?
Avatar
Asian black bear
yes, quota limits
Avatar
joulev
you can cache locally as well
Avatar
risky
so its a viable option, while unfortunate
Avatar
joulev
vercel build && vercel deploy --prebuilt is a popular way for people who can't use the git integration for reasons
Avatar
Asian black bear
the vercel deploy command allows orders of magnitde less deploys under 'fair use'
unless they walked that back
Avatar
joulev
really? didn't know about this
in fact, i don't know of any limit in terms of the number of builds on vercel
Avatar
Asian black bear
it was a source of ENORMOUS contention a few years ago
Avatar
risky
[we process and use the build output from Vercel](https://github.com/cloudflare/next-on-pages/pull/289#issuecomment-1570953757)
cloudflare/next-on-pages uses vercel build think...
Avatar
joulev
it was back when i never knew vercel existed so idk about this enormous thing then. but vercel CLI itself doesn't have any separate pricing model as far as i know of. you are limited to 100/3000 deployment per day (hobby/pro plan), regardless of whether you use CLI or native git integration. back when i didn't have vercel pro using the CLI was how i deployed my monorepo (> 3 projects) to vercel, it worked completely fine
Avatar
Asian black bear
Deployments Created from CLI per Week hobby 2000 pro 2000 enterprise Custom
it is much less austere than it use to be, but still quite less than 42000....
Avatar
joulev
ok good to know, i didn't know about this. that said are you going to reach 2000 deployments in 7 days? if you had that many developers and projects to be able to reach 2000 deployments you might as well just buy enterprise or hire a devops team to ditch vercel entirely and self-build self-deploy
Avatar
Asian black bear
Haha, at one time I think it was like 200? They openly said it was to "encourage use of the git integration"
vercel is super awesome to use, but when they are frustrating about something...
Avatar
joulev
oh... that was bad indeed
200 then it was a real limit to be concerned about
Avatar
Asian black bear
yeah, it was definitely something that could actually happen
Avatar
risky
i thought built time was the only limit...
Image
Avatar
joulev
same too, but that limit table in the docs is super hidden
they should just add one row to the pricing page saying 2000 2000 Custom
Avatar
Asian black bear
Avatar
risky
ahh ok 100 per day is decent
Avatar
Asian black bear
they are annoying because you can't just throw money at a lot of them
it is a little "enterprise cliff"
Avatar
risky
once you are pro, you must be enterprise to get more
Avatar
Asian black bear
It actually shows the function region under the build in Deployment Details -> Deployment Summary -> Functions
Image
waaaaay on the right
Avatar
risky
lol i didn't realize what its purpose was...
Avatar
Asian black bear
I actually try to answer questions here to learn stuff
Avatar
risky
same, now i know about this thing 🙂