How to guard a website/app behind VPN network


I’m developing a NextJS web app and I want to setup a dev env such that there’s always a up-to-date application reading from the github repo.

However, since it’s the dev branch, I want to it only be accessed if the request is ona VPN.

My plan

    1. Setup a VPN service in a droplet (solved, there’s tutorial)
    1. Deploy an app such that it’s only accessible when on that VPN (? not sure how to achieve this)

I imagine i can do some IP check in NextJS? but wondering if there’s more elegant solution like setup the firewall on 2)'s droplet (I guess I cannot just deploy it through the App product)

Wondering if anyone did similar and can offer some input. Thanks

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer