Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
* text eol=lf
.github/* linguist-vendored
24 changes: 24 additions & 0 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
workflow "gitbook deploy" {
on = "push"
resolves = ["gitbook-deploy"]
}

action "gitbook-deploy" {
uses = "docker://khs1994/gitbook"
args = "deploy"
secrets = ["GITHUB_TOKEN"]
env = {
GIT_USERNAME = "khs1994"
GIT_USEREMAIL = "[email protected]"
GIT_BRANCH = "gh-pages"
}
}

workflow "gitbook build" {
on = "pull_request"
resolves = ["gitbook-build"]
}

action "gitbook-build" {
uses = "docker://khs1994/gitbook"
}
8 changes: 5 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- 指令字母索引
- 变量字母索引
- [核心功能](模块参考/核心功能.md)
- HTTP
- HTTP
- [ngx_http_core_module](模块参考/http/ngx_http_core_module.md)
- [ngx_http_access_module](模块参考/http/ngx_http_access_module.md)
- [ngx_http_addition_module](模块参考/http/ngx_http_addition_module.md)
Expand Down Expand Up @@ -75,11 +75,11 @@
- [ngx_http_realip_module](模块参考/http/ngx_http_realip_module.md)
- [ngx_http_referer_module](模块参考/http/ngx_http_referer_module.md)
- [ngx_http_rewrite_module](模块参考/http/ngx_http_rewrite_module.md)
- ngx_http_scgi_module
- [ngx_http_scgi_module](模块参考/http/ngx_http_scgi_module.md)
- ngx_http_secure_link_module
- ngx_http_session_log_module
- [ngx_http_slice_module](模块参考/http/ngx_http_slice_module.md)
- [ngx_http_spdy_module](模块参考/http/ngx_http_spdy_module.md)
- [ngx_http_spdy_module 被 ngx_http_v2_module 替代](模块参考/http/ngx_http_spdy_module.md)
- [ngx_http_split_clients_module](模块参考/http/ngx_http_split_clients_module.md)
- ngx_http_ssi_module
- ngx_http_ssl_module
Expand Down Expand Up @@ -107,6 +107,7 @@
- [ngx_stream_geo_module](模块参考/stream/ngx_stream_geo_module.md)
- [ngx_stream_geoip_module](模块参考/stream/ngx_stream_geoip_module.md)
- [ngx_stream_js_module](模块参考/stream/ngx_stream_js_module.md)
- ngx_stream_keyval_module
- [ngx_stream_limit_conn_module](模块参考/stream/ngx_stream_limit_conn_module.md)
- [ngx_stream_log_module](模块参考/stream/ngx_stream_log_module.md)
- ngx_stream_map_module
Expand All @@ -119,5 +120,6 @@
- ngx_stream_upstream_module
- ngx_stream_upstream_hc_module
- ngx_stream_zone_sync_module
- ngx_stream_zone_sync_module
- 其他
- [ngx_google_perftools_module](模块参考/google/ngx_google_perftools_module.md)
13 changes: 6 additions & 7 deletions 介绍/Windows下的Nginx.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Windows 下的 nginx

Nginx 的 Windows 版本使用了本地的 Win32 API(而不是 Cygwin 模拟层)。目前仅使用 `select()` 连接处理方式。由于此版本和其他存在已知的问题的 Nginx Windows 版本都被认为是 beta 版本,因此您不应该期望它具有高性能和可扩展性。现在,它提供了与 Unix 版本的 nginx 几乎相同的功能,除了 XSLT 过滤器、图像过滤器、GeoIP 模块和嵌入式 Perl 语言。
Nginx 的 Windows 版本使用了本地的 Win32 API(而不是 Cygwin 模拟层)。目前仅使用 `select()` 和 `poll()` (1.15.9) 连接处理方式。由于此版本和其他存在已知的问题的 Nginx Windows 版本都被认为是 beta 版本,因此您不应该期望它具有高性能和可扩展性。现在,它提供了与 Unix 版本的 nginx 几乎相同的功能,除了 XSLT 过滤器、图像过滤器、GeoIP 模块和嵌入式 Perl 语言。

<!-- more -->

要安装 nginx 的 Windows 版本,请 [下载](http://nginx.org/en/download.html) 最新的主线发行版(1.13.4),因为 nginx 的主线分支包含了所有已知的补丁。之后解压文件到 `nginx-1.13.4` 目录下,然后运行 `nginx`。以下是 `C盘` 的根目录:
要安装 nginx 的 Windows 版本,请 [下载](http://nginx.org/en/download.html) 最新的主线发行版(1.15.10),因为 nginx 的主线分支包含了所有已知的补丁。之后解压文件到 `nginx-1.15.10` 目录下,然后运行 `nginx`。以下是 `C盘` 的根目录:

```bash
cd c:\
unzip nginx-1.13.4.zip
cd nginx-1.13.4
unzip nginx-1.15.10.zip
cd nginx-1.15.10
start nginx
```

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

```bash
C:\nginx-1.13.4>tasklist /fi "imagename eq nginx.exe"
C:\nginx-1.15.10>tasklist /fi "imagename eq nginx.exe"

Image Name PID Session Name Session# Mem Usage
=============== ======== ============== ========== ============
Expand All @@ -25,7 +25,7 @@ nginx.exe 1332 Console 0 3 112 K
```
其中有一个是主进程(master),另一个是工作进程(worker)。如果 nginx 未能启动,请在错误日志 `logs\error.log` 中查找原因。如果日志文件尚未创建,可以在 Windows 事件日志中查找原因。如果显示的页面为错误页面,而不是预期结果,也可以在 `logs\error.log` 中查找原因。

Nginx 的 Windows 版本使用运行目录作为配置文件中的相对路径前缀。在上面的例子中,前缀是 `C:\nginx-1.13.4\`。在配置文件中的路径必须使类 Unix 风格的正斜杠:
Nginx 的 Windows 版本使用运行目录作为配置文件中的相对路径前缀。在上面的例子中,前缀是 `C:\nginx-1.15.10\`。在配置文件中的路径必须使类 Unix 风格的正斜杠:

```nginx
access_log logs/site.log;
Expand All @@ -40,7 +40,6 @@ Nginx 的 Windows 版本作为标准的控制台应用程序(而不是服务

## 已知问题
- 虽然可以启动多个工作进程,但实际上只有一个工作进程做完全部的工作
- 一个工作进程可以处理不超过 1024 个并发连接
- 不支持 UDP 代理功能

## 以后可能的发展
Expand Down
6 changes: 4 additions & 2 deletions 模块参考/http/ngx_http_mirror_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

`ngx_http_mirror_module` 模块(1.13.4)通过创建后台镜像子请求来实现原始请求的镜像。镜像子请求的响应将被忽略。

> 译者注:利用 mirror 模块,业务可以将线上实时访问流量拷贝至其他环境,基于这些流量可以做版本发布前的预先验证,进行流量放大后的压测等等。

<a id="example_configuration"></a>

## 示例配置
Expand Down Expand Up @@ -35,7 +37,7 @@ location /mirror {
|**默认**|mirror off;|
|**上下文**|http、server、location|

设置将做成镜像的原始请求的 URI。可以在同一层级上指定多个镜像。
设置将做成镜像的原始请求的 URI。可以在同一层级上指定多个镜像(译者注: 多次重复一个镜像可以实现流量放大)

### mirror_request_body

Expand Down Expand Up @@ -63,4 +65,4 @@ location /mirror {
}
```
## 原文档
[http://nginx.org/en/docs/http/ngx_http_mirror_module.html](http://nginx.org/en/docs/http/ngx_http_mirror_module.html)
[http://nginx.org/en/docs/http/ngx_http_mirror_module.html](http://nginx.org/en/docs/http/ngx_http_mirror_module.html)
6 changes: 3 additions & 3 deletions 模块参考/http/ngx_http_spdy_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
- [spdy_headers_comp](#spdy_headers_comp)
- [内嵌变量](#embedded_variables)

**该模块已被 `1.9.5` 中的 [ngx_http_v2_module](http://nginx.org/en/docs/http/ngx_http_v2_module.html) 模块所取代。**

`ngx_http_spdy_module` 模块为 [SPDY](http://www.chromium.org/spdy/spdy-protocol) 提供实验性支持。目前,SPDY 协议[草案 3.1](http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3-1)已实施。

> 在 1.5.10 版之前,已实施 SPDY 协议[草案 2](http://www.chromium.org/spdy/spdy-protocol/spdy-protocol-draft2)。

默认情况下不构建此模块,可在构建 nginx 时使用 `--with-http_spdy_module` 配置参数启用它。

> 该模块已被 1.9.5 中的 [ngx_http_v2_module](http://nginx.org/en/docs/http/ngx_http_v2_module.html) 模块所取代。

<a id="issues"></a>

## 已知问题
Expand Down Expand Up @@ -81,6 +81,6 @@ server {
- `$spdy_request_priority`

请求 SPDY 连接的优先级,无则为空字符串

## 原文档
[http://nginx.org/en/docs/http/ngx_http_spdy_module.html](http://nginx.org/en/docs/http/ngx_http_spdy_module.html)