Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nginx
GitHub Repository: nginx/nginx.org
Path: blob/main/xml/en/docs/windows.xml
1 views
1
<!--
2
Copyright (C) Igor Sysoev
3
Copyright (C) Nginx, Inc.
4
-->
5
6
<!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
7
8
<article name="nginx for Windows"
9
link="/en/docs/windows.html"
10
lang="en"
11
rev="6">
12
13
<section>
14
15
<para>
16
Version of nginx for Windows uses the native Win32 API (not the Cygwin emulation
17
layer).
18
Only the <c-func>select</c-func> and <c-func>poll</c-func> (1.15.9)
19
connection processing methods are currently used,
20
so high performance and scalability should not be expected.
21
Due to this and some other known issues version of nginx for Windows
22
is considered to be a <i>beta</i> version.
23
At this time, it provides almost the same functionality as a UNIX version
24
of nginx except for
25
XSLT filter, image filter, GeoIP module, and embedded Perl language.
26
</para>
27
28
<para>
29
To install nginx/Windows, <link doc="../download.xml">download</link>
30
the latest mainline version distribution (<mainline_version/>),
31
since the mainline branch of nginx contains all known fixes.
32
Then unpack the distribution, go to the
33
nginx-<mainline_version/>
34
directory, and run <command>nginx</command>.
35
Here is an example for the drive C: root directory:
36
37
<programlisting>
38
cd c:\
39
unzip nginx-<mainline_version/>.zip
40
cd nginx-<mainline_version/>
41
start nginx
42
</programlisting>
43
44
Run the <command>tasklist</command> command-line utility
45
to see nginx processes:
46
47
<programlisting>
48
C:\nginx-<mainline_version/>&gt;tasklist /fi "imagename eq nginx.exe"
49
50
Image Name PID Session Name Session# Mem Usage
51
=============== ======== ============== ========== ============
52
nginx.exe 652 Console 0 2 780 K
53
nginx.exe 1332 Console 0 3 112 K
54
</programlisting>
55
56
One of the processes is the master process and another is the worker process.
57
If nginx does not start, look for the reason in
58
the error log file <path>logs\error.log</path>.
59
If the log file has not been created, the reason for this should be reported
60
in the Windows Event Log.
61
If an error page is displayed instead of the expected page, also look
62
for the reason in the <path>logs\error.log</path> file.
63
</para>
64
65
<para>
66
nginx/Windows uses the directory where it has been run as the prefix
67
for relative paths in the configuration.
68
In the example above, the prefix is
69
<path>C:\nginx-<mainline_version/>\</path>.
70
Paths in a configuration file must be specified in UNIX-style using
71
forward slashes:
72
73
<programlisting>
74
access_log logs/site.log;
75
root C:/web/html;
76
</programlisting>
77
</para>
78
79
<para>
80
nginx/Windows runs as a standard console application (not a service),
81
and it can be managed using the following commands:
82
83
<table note="yes">
84
85
<tr>
86
<td width="20%">nginx -s stop</td>
87
<td>fast shutdown</td>
88
</tr>
89
90
<tr>
91
<td>nginx -s quit</td>
92
<td>graceful shutdown</td>
93
</tr>
94
95
<tr>
96
<td>nginx -s reload</td>
97
<td>
98
changing configuration,
99
starting new worker processes with a new configuration,
100
graceful shutdown of old worker processes
101
</td>
102
</tr>
103
104
<tr>
105
<td>nginx -s reopen</td>
106
<td>re-opening log files</td>
107
</tr>
108
109
</table>
110
</para>
111
112
</section>
113
114
<section id="known_issues"
115
name="Known issues">
116
117
<list type="bullet">
118
119
<listitem>
120
Although several workers can be started, only one of them
121
actually does any work.
122
</listitem>
123
124
<listitem>
125
The UDP (and, inherently, QUIC) functionality is not supported.
126
</listitem>
127
128
</list>
129
130
</section>
131
132
<section id="possible_future_enhancements"
133
name="Possible future enhancements">
134
135
<list type="bullet">
136
137
<listitem>
138
Running as a service.
139
</listitem>
140
141
<listitem>
142
Using the I/O completion ports as a connection processing method.
143
</listitem>
144
145
<listitem>
146
Using multiple worker threads inside a single worker process.
147
</listitem>
148
149
</list>
150
151
</section>
152
153
</article>
154
155