步驟二:在nginx資料夾下創建 nginx-winsw.xml 文件,並輸入以下內容後存檔
nginx-winsw.xml
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<service>
<id>Nginx</id>
<name>Nginx</name>
<description>本服務用於加載Nginx服務,請確保開機啟動。</description>
<logpath>C:\Users\yiru\Downloads\nginx-1.19.6\nginx\logs</logpath>
<executable>nginx.exe</executable>
<stopexecutable>nginx.exe</stopexecutable>
<stopargument>-s</stopargument>
<stopargument>stop</stopargument>
<logmode>rotate</logmode>
</service>
建好這兩個檔案之後,目錄檔案如下: