Hacker News new | ask | show | jobs
by firefoxd 45 days ago
There's a simple method you can use with nginx and /etc/hosts, I wrote about it couple days ago [0]. I used it for an internal demo recently and realized that a new breed of devs have never seen a non localhost url run locally.

[0]: https://idiallo.com/blog/say-no-to-localhost3000-use-custom-...

2 comments

Custom domain is nice if you're planning on a real host later, but nowadays you can just use the .localhost domain and skip the whole /etc/hosts editing thing.
I essentially do this.

Super simple. (although I use rewrites at my dns layer for the whole local lan, but whatever)

It also solves issues my password manager has with multiple services on the one host but with different ports, but putting each on their own 2nd level domain.