On Sun May 31, 2026 at 6:42 PM BST, Nicolas George wrote: > Andre Rodier (HE12026-05-31): >> Hello, >> >> I have an Nginx server running on Debian Trixie, as a "user" systemd >> service. It is working, but if I have 100 users, I don't want to spawn >> 100 nginx servers just for waiting for connections. >> >> Each nginx instance "listen" on a unix socket in /run/user directory. >> >> I tried sockets triggering, and while the log is working, triggering >> the nginx server fails, because the socket is already opened. >> >> Is there a better way to achieve this, i.e. spawning nginx instance on >> demand ? > > First hit on a web search about “nginx systemd socket activation”: > > https://www.freedesktop.org/wiki/Software/systemd/DaemonSocketActivation/ > > Not tested it. > > But if you need to start 100 instances of nginx and are looking how to > achieve it, you probably have an XY problem where you mistakenly assumed > you need 100 instances of nginx to achieve your real goal. But you have > not share your real goal. > > Regards,
> First hit on a web search about “nginx systemd socket activation”: Yes, I can use a search engine too, found the same kind of results, and they're not really helpful. I can detail more what I have so far, then. - I have one nginx instance, running as a system systemd service, usng basic authentication (on pam). - I have nginx user instances for each user (used as webdav servers) - The system server uses proxy_pass directive to dispatch queries to each user’s nginx instance. In the system instnace, the dispatch works with this block: ~~~ proxy_pass http://unix:/var/tmp/webdav-user/$remote_user/socket; root /home/$remote_user/webdav/root; autoindex on; ~~~ Everything works as expected. However, if I had 100 users (that's just an example), I would like to avoid having 100 nginx instances waiting. I would like to spawn the user’s instance on demand, not having them waiting for nothing. I tested the socket activation, and the systemd logic is working, i.e. it is calling the user systemd service. BUT, the user service fails to start, because the socket is own by systemd. I hope it is clear for everyone. Thanks -- 🌐 https//rodier.me/
signature.asc
Description: PGP signature

