title: run nginx as windows service
body: <p>I am trying to run nginx (reverse proxy) as a windows service so that it's possible to proxy a request even when a user is not connected.</p>
  
  <p>I searched a lot around and found <a href="https://github.com/kohsuke/winsw" rel="noreferrer">winsw</a> that should create a service from an .exe file (such as nginx).</p>
  
  <p>i found many tutorials online saying to create an xml file as following</p>
  
  <pre><code>&lt;service&gt;
     &lt;id&gt;nginx&lt;/id&gt;
     &lt;name&gt;nginx&lt;/name&gt;
     &lt;description&gt;nginx&lt;/description&gt;
     &lt;executable&gt;c:\nginx\nginx.exe&lt;/executable&gt;
     &lt;logpath&gt;c:\nginx\&lt;/logpath&gt;
     &lt;logmode&gt;roll&lt;/logmode&gt;
     &lt;depend&gt;&lt;/depend&gt;
     &lt;startargument&gt;-p c:\nginx&lt;/startargument&gt;
     &lt;stopargument&gt;-p c:\nginx -s stop&lt;/stopargument&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>(i have nginx.exe in a folder called nginx under c: o the paths are correct).</p>
  
  <p>Now the problem is that the service is created but i can't seem to make it start, every time i try to start it a windows pops up saying</p>
  
  <pre><code>Error 1053: The service didn't respond to the start or control request in a timely fashion
  </code></pre>
  
  <p>Does anyone know how can i fix this or a different way to run nginx as a window service?</p>