10 ms·
Ask HN: How do you deploy Go on bare metal?
How have you chosen to deploy your Go web server on bare metal running on port 443 without running it as root?
- verdverm 4y agoNginx, caddy, or any other proxy in front of it
- iio7 4y agoWhy put anything in front of it? I have never understood when people do this since Go has a fully working and production ready web server already build in. Is it to avoid the issue of running it as root?
- verdverm 4y agoBecause there are a lot of things you'd have to reimplement in your Go server. CSP headers and cache control are at the top of that list. You will also get good upstream failover once you start to scale. Path rewrites and forwarding is trivial in nginx compared to Go as well.
- toast0 4y agoOn FreeBSD, you can set the privileged port lower. I prefer setting it to port 79, so whatever webserver doesn't need to run or start as root. MacOS should have the same sysctl, IIRC, and I think Linux can delegate priviledged ports some other way.