Nextjs deployment

Guys I’m getting 502 on my nextjs build what’s the possible reason I’m using middleware anything I should be aware of?