Bind to Privileged Ports (Port 443)
mainBy default, HTTPS clients expect port 443. Since binding to ports under 1024 requires privileges, you can use one of the following strategies on Linux:
- Reverse Proxy/Load Balancer: Use Nginx or HAProxy to listen on 443 and forward traffic to your Elixir app on an unprivileged port.
- IPTables: Create a rule to forward packets from 443 to your application's port.
- setcap: Grant the Erlang/OTP runtime permission to bind to privileged ports (e.g.,
sudo setcap 'cap_net_bind_service=+ep' /path/to/beam.smp). - authbind: Use
authbindto allow an unprivileged user to bind to specific ports.