Nginx 教程

主要文档

Nginx功能概述 为什么选择Nginx Nginx安装 常见问题(FAQ) 配置符号参考 调试 nginx 优化 Nginx 运行和控制Nginx

核心模块

Nginx事件模块 Nginx主模块

基本模块

Browser模块 Charset模块 Geo模块 HttpAccess模块 HttpAuthBasic模块 HttpAutoindex模块 HttpEmptyGif模块 HttpFcgi模块 HttpGzip模块 HttpHeaders模块 HttpIndex模块 HttpIndex模块. HttpLimit zone HttpLimitReqest模块 HttpLog模块 HttpProxy模块 HttpRewrite模块 HttpSSI模块 HttpUserId http核心模块 map Memcached

其他模块

Addition模块 EmbeddedPerl flv GooglePerftools HttpDav模块 HttpGeoIP HttpGzipStatic HttpImageFilter HttpRealIp HttpSecureLink HttpSSL HttpSubstitution HttpXSLT RandomIndex StubStatus模块

mail模块

MailAuth MailCore MailProxy MailSSL

安装

nginx php-fpm安装配置 nginx在fedora上的安装 nginx在freebsd上的安装 nginx在ubuntu上的安装 nginx在windows上的安装

配置示例和方法

HWLoadbalancerCheckErrors nginx防盗链 负载均衡 完整例子 完整例子2 虚拟主机

MailProxy


Nginx can proxy IMAP, POP3, and SMTP protocols.
Ngin可以代理IMAP,POP3和SMTP协议

指令

proxy

syntax:*proxy*on | off

default:*off*

context:*mail, server*

With this directive you can enable or disable the proxy for mail.
使用这条指令你可以开启和关闭邮件代理

proxy_buffer

syntax:*proxy_buffer*size

default:*4K/8K*

context:*mail, server*

With this directive you can set the buffer size for the proxy connection. The default value is equal to the size of a page (this can be either 4K or 8K depending on the platform).
使用这条指令你可以设置代理连接的缓存大小。默认值为页面的大小(这个根据平台的不同可能是4K或者8K)

proxy_pass_error_message

syntax:*proxy_pass_error_message*on | off

default:*off*

context:*mail, server*

With this directive you can pass authentification error messages obtained from the backend back to the client. Usually if authorization in nginx passed successfully then the backend cannot return errors back to the client.
通过这条指令你可以使得客户端忽略从后端获得的验证错误消息.通常验证成不会返回错误消息到客户端。

But for some POP3 servers errors in response to correct password is a regular behavior. For example CommuniGatePro notifies user about overcrowding of the mailbox (or other events) periodically issuing an error in authorization. In this case is worth indicating proxy_error_message on.
但是在POP3服务器中错误是用来更重密码。例如CommuniGatePro 通过验证返回邮箱收件箱已满的错误来通知用户,这样的代理错误信息是很有意义的。

proxy_timeout

syntax:*proxy_timeout*time

default:*24h*

context:*mail, server*

With this directive you can set the timeout for the proxy connection.
使用这条指令你可以设置代理连接的超时时间。

xclient

syntax:*xclient*on | off

default:*on*

context:*mail, server*

With this directive you can enable or disable the command XCLIENT with the connection to SMTP backend. This allows the backend to enforce limitations on the client based on IP/HELO/LOGIN.
使用这条指令你可以开启或者关闭命令XCLIENT的SMTP后端连接.这个使得后端强制可以通过IP/HELO/LOGIN限定客户端

If xclient is enabled then nginx first transfers to the backend:
如果xclient被启用,nginx首先转换到后端

EHLO server_name 

Then:

XCLIENT PROTO=ESMTP HELO=client_helo ADDR=client_ip LOGIN=authentificated_user NAME=[UNAVAILABLE]