DEV Community

Discussion on: Running SSL on localhost

Collapse
 
xowap profile image
Rémy 🤖

Other method:

  1. Get a domain, let's say foobar.com
  2. Get a wildcard for *.foobar.com
  3. Setup a local nginx (on port 443) with that certificate on all vhosts
  4. For each project, create a vhost that proxies back to your app. Say app1.foobar.com is a proxy to localhost:4000
  5. Add 127.0.0.1 app1.foobar.com to your /etc/hosts
Collapse
 
_nicovillanueva profile image
Nico

Now this is a nerdy, overcomplicated solution that I like.

Collapse
 
daniel15 profile image
Daniel Lo Nigro

Let's Encrypt makes this pretty easy, and free. What I usually do is have localhost.foobar.com resolve to 127.0.0.1, and either have a Let's Encrypt wildcard cert, or a cert specifically for localhost.foobar.com