Znc hosting

From wikinotes

Nginx Reverse Proxy

ZNC's port serves both HTTP and irc traffic.
You'll need to split them up onto separate ports if you intend to use them within a reverse proxy.

See https://wiki.znc.in/Reverse_Proxy

TODO:

This setup allows joining channels, but breaks bitlbee (it guesses loopback address incorrectly).
I need to look into this more deeply, I may be able to solve it with:

  • configuring actual ip addr instead of loopback in ZNC admin panel
  • some pf rdr rules


# /usr/local/etc/nginx/nginx.conf

# this will proxy BOTH http and irc over the same port
# (just like znc normally runs)

load_module /usr/local/libexec/nginx/ngx_stream_module.so;

stream {
  server {
    listen 1025 ssl;
    ssl_certificate /usr/local/etc/live/domain.com/fullchain.pem;
    ssl_certificate_key /usr/local/etc/live/domain.com/privkey.pem;
    ssl_trusted_certificate /usr/local/etc/live/domain.com/chain.pem;
    proxy_pass 10.0.0.1:1025;
  }
}