···14141515 enableReload = true;
16161717+ # nginx defaults to one worker with 512 connections, and a proxied
1818+ # websocket costs two of them (client + upstream). maze.lassul.us hit
1919+ # "512 worker_connections are not enough" at ~250 players, which takes
2020+ # down every other vhost on the box with it.
2121+ eventsConfig = ''
2222+ worker_connections 8192;
2323+ multi_accept on;
2424+ '';
2525+ appendConfig = ''
2626+ worker_processes auto;
2727+ worker_rlimit_nofile 65536;
2828+ '';
2929+1730 # avoid nixpkgs nginx's /tmp/nginx_* compile-time defaults: under
1831 # systemd PrivateTmp they don't survive a host `rm -rf /tmp/*`.
1932 appendHttpConfig = ''
···3649 locations."~ ^/.well-known/acme-challenge/".root = "/var/lib/acme/acme-challenge";
3750 };
3851 };
5252+5353+ # worker_rlimit_nofile above only matters if systemd lets nginx have them.
5454+ systemd.services.nginx.serviceConfig.LimitNOFILE = 65536;
3955}