but if i start the windows service created with nssm it appears that nothing is happening. i canāt get to my site and no logs are created. Iāve set the service to run under the same account that iām using when i run this from the cmd line.
4. Error messages and/or full log output:
caddy isnāt throwing any logs, nssm stderr.log shows that the caddy server is running but doesnāt explain why it works when running from cmd prompt but not in a service.
5. What I already tried:
Iāve tried other methods of creating the service, a different caddyfile, tried using localhost:2019 and still unable to work when running as a service.
I donāt use Windows so I donāt know much about it, but I can say that your caddy command looks like itās still using the v1 command line arguments and flags, which wonāt work.
thanks Matt! I stood up an ubuntu box and installed but it didnāt like the caddyfile from above. specifically, it barked about ātheheadersā. I removed that piece but then it wasnāt doing the proxy or the ssl piece. the client is working beautifully on windows, I just canāt run it as a service.
I donāt use Windows so I donāt know much about it
Just to let you know: The reason that Iām using Caddy, is that it does indeed run on Windows.
Companies that donāt have dedicated reverse proxies / load balancers (like Netscaler or other products) are most often running Windows only environments (in my experience).
For them, an easy to install and configure reverse proxy is essential that it can run on Windows.
(Even though it is not your favorite os.
Now, getting V2 ready is by far the first priority. But Iād think getting a stable platform for Windows is well worth the investment.
NSSM is an option. But I prefer not having too many building blocks. Keep it simple. Make ācaddy startā start the Windows service Caddy Server.
I donāt have a āfavorite OSā ā I just donāt use Windows, regardless of how many companies may use it or like it. Feel free to compile a guide to set it up as a Windows service. I donāt know how, so I canāt do it.
@Brian, NSSM has a good reputation. If you (or anyone else) prefer running Caddy without installing anything extra, it is also possible to use the standard Windows Task Scheduler:
Create task
On Trigger, you change āOn a scheduleā (at the very top), to āAt startupā
I guess it depends on how stable V2 is, running on Windows. As I donāt think you get the same restart-on-failure capabilities with Task Scheduler. But is another option with plain Windows.
If thereās a canonical way ā or maybe two ways ā to set up Caddy as a Windows service, Iāll add it to Install ā Caddy Documentation. Just tell me what it is.