Add nginx.exe as Windows system service (like Apache)?

前端 未结 9 1087
面向向阳花
面向向阳花 2020-12-04 07:08

I set up NGINX as a front end server for static content and I use Apache as a back-end server for other thing.

The thing is I can\'t find a logical answer that allow

9条回答
  •  误落风尘
    2020-12-04 07:19

    SC.EXE will only work for executables that already support the Windows Services API and can respond properly to start and stop requests from the Services Control Manager (SCM). Other regular applications, not specifically written as a service, will simply fail to start (usually with error 1053)...

    For those exe's, you need a "service wrapper" -- a small utility that can accept the start/stop commands from the SCM and run/terminate your application accordingly. Microsoft provides Srvany (which is free yet very basic), but there are several other free and commercial alternatives.

    BTW, you should check out this guide showing how to run Nginix as a service, especially step 7 which discusses how to stop Nginix properly. Not every wrapper will support that functionality (Srvany doesn't)...

提交回复
热议问题