Do not use forEach with async-await TLDR: Use for...of instead of forEach() in asynchronous code. For legacy browsers, use for...i or [].reduce() To execute the promises in parallel, use Promise.all([].map(...)) The problem
How to setup Next.js app on Nginx with letsencrypt Next.js, Nginx with Reverse proxy, SSL certificate UPDATE (07/20/2021): This process got simplified over the years of this gist being out Older version of this gist (without certbot): https://gist.github.com/kocisov/2a9567eb51b83dfef48efce02ef3ab06/33fdd88872a0801bdde58fccce430fa48737ae10 I would also now recommend deploying to Vercel if you don't need custom server support 1. Install Nginx, Node and certbot