非常教程

Nginx参考手册

指南 | Guides

nginx for Windows

  • 已知的问题
  • 可能的未来增强性

Windows的nginx版本使用本机Win32 API(不是Cygwin仿真层)。select()目前仅使用连接处理方法,因此不应期望高性能和可伸缩性。由于这个和其他一些已知问题,Windows版本的nginx被认为是beta版本。目前,除了XSLT过滤器,图像过滤器,GeoIP模块和嵌入式Perl语言之外,它提供的功能几乎与UNIX版本的nginx相同。

要安装nginx / Windows,请下载最新的主线版本分布(1.13.6),因为nginx的主线分支包含所有已知的修补程序。然后解压该分发包,转到nginx-1.13.6目录,然后运行nginx。以下是驱动器C:根目录的示例:

cd c:\
unzip nginx-1.13.6.zip
cd nginx-1.13.6
start nginx

运行tasklist命令行工具来查看nginx进程:

C:\nginx-1.13.6>tasklist /fi "imagename eq nginx.exe"

Image Name           PID Session Name     Session#    Mem Usage
=============== ======== ============== ========== ============
nginx.exe            652 Console                 0      2 780 K
nginx.exe           1332 Console                 0      3 112 K

其中一个进程是主进程,另一个进程是工作进程。 如果nginx没有启动,请在错误日志文件logs \ error.log中查找原因。 如果日志文件尚未创建,则应在Windows事件日志中报告此原因。 如果显示错误页面而不是预期页面,请在logs \ error.log文件中查找原因。

nginx / Windows使用它已经运行的目录作为配置中相对路径的前缀。在上面的例子中,前缀是C:\nginx-1.13.6\。配置文件中的路径必须使用正斜杠指定为UNIX样式:

access_log   logs/site.log;
root         C:/web/html;

nginx / Windows作为标准控制台应用程序(而不是服务)运行,并且可以使用以下命令进行管理:

nginx -s停止

快速关机

nginx -s退出

缓慢关机

nginx -s重新加载

更改配置,使用新配置启动新工作进程,正常关闭旧工作进程

nginx -s重新打开

重新打开日志文件

已知的问题

  • 尽管可以启动几名工作人员,但其中只有一名工作人员实际上工作。
  • 一名工作人员可以处理不超过1024个同时连接。
  • UDP代理功能不受支持。

可能的未来增强性

  • 作为服务运行。
  • 使用I / O完成端口作为连接处理方法。
  • 在单个工作进程中使用多个工作线程。
Nginx

Nginx是一款轻量级的 Web 服务器/反向代理服务器及电子邮件代理服务器,可在 BSD-like 协议下发行。其特点是占有内存少,并发能力强。

主页 https://nginx.org/
源码 http://hg.nginx.org/nginx
发布版本 1.13.6

Nginx目录

1.指南 | Guides
2.核心 | Core
3.ngx_google_perftools_module
4.ngx_http_access_module
5.ngx_http_addition_module
6.ngx_http_api_module
7.ngx_http_auth_basic_module
8.ngx_http_auth_jwt_module
9.ngx_http_auth_request_module
10.ngx_http_autoindex_module
11.ngx_http_browser_module
12.ngx_http_charset_module
13.ngx_http_core_module
14.ngx_http_dav_module
15.ngx_http_empty_gif_module
16.ngx_http_f4f_module
17.ngx_http_fastcgi_module
18.ngx_http_flv_module
19.ngx_http_geoip_module
20.ngx_http_geo_module
21.ngx_http_gunzip_module
22.ngx_http_gzip_module
23.ngx_http_gzip_static_module
24.ngx_http_headers_module
25.ngx_http_hls_module
26.ngx_http_image_filter_module
27.ngx_http_index_module
28.ngx_http_js_module
29.ngx_http_keyval_module
30.ngx_http_limit_conn_module
31.ngx_http_limit_req_module
32.ngx_http_log_module
33.ngx_http_map_module
34.ngx_http_memcached_module
35.ngx_http_mirror_module
36.ngx_http_mp4_module
37.ngx_http_perl_module
38.ngx_http_proxy_module
39.ngx_http_random_index_module
40.ngx_http_realip_module
41.ngx_http_referer_module
42.ngx_http_rewrite_module
43.ngx_http_scgi_module
44.ngx_http_secure_link_module
45.ngx_http_session_log_module
46.ngx_http_slice_module
47.ngx_http_spdy_module
48.ngx_http_split_clients_module
49.ngx_http_ssi_module
50.ngx_http_ssl_module
51.ngx_http_status_module
52.ngx_http_stub_status_module
53.ngx_http_sub_module
54.ngx_http_upstream_conf_module
55.ngx_http_upstream_hc_module
56.ngx_http_upstream_module
57.ngx_http_userid_module
58.ngx_http_uwsgi_module
59.ngx_http_v2_module
60.ngx_http_xslt_module
61.ngx_mail_auth_http_module
62.ngx_mail_core_module
63.ngx_mail_imap_module
64.ngx_mail_pop3_module
65.ngx_mail_proxy_module
66.ngx_mail_smtp_module
67.ngx_mail_ssl_module
68.ngx_stream_access_module
69.ngx_stream_core_module
70.ngx_stream_geoip_module
71.ngx_stream_geo_module
72.ngx_stream_js_module
73.ngx_stream_limit_conn_module
74.ngx_stream_log_module
75.ngx_stream_map_module
76.ngx_stream_proxy_module
77.ngx_stream_realip_module
78.ngx_stream_return_module
79.ngx_stream_split_clients_module
80.ngx_stream_ssl_module
81.ngx_stream_ssl_preread_module
82.ngx_stream_upstream_hc_module
83.ngx_stream_upstream_module