DEV Community

Discussion on: HTTP Basic Auth for Next.js

Collapse
 
kalabro profile image
Kate

Thanks for sharing @kkomelin !

We currently use a custom server approach (via express-basic-auth) on our projects. In future, we want to get rid of a custom server because it breaks some Next.js features like SSG. Looks like Next.js ecosystem doesn't offer a "perfect" solution for it...

Collapse
 
kkomelin profile image
Konstantin Komelin • Edited

You're welcome!
Then in your case I would recommend having a proxy sever on top of your next app which in its turn would provide HTTP auth layer, SSL layer, etc. If your app is containerized, jwilder/nginx-proxy works great for that.