电脑技术学习

nginx 服务器简介

dn001

--with-md5-opt=OPTIONS - Set additional options for md5 building.

--with-md5-asm - Use md5 assembler sources.

--with-sha1=DIR - Set path to sha1 library sources.

--with-sha1-opt=OPTIONS - Set additional options for sha1 building.

--with-sha1-asm - Use sha1 assembler sources.

--with-zlib=DIR - Set path to zlib library sources.

--with-zlib-opt=OPTIONS - Set additional options for zlib building.

--with-zlib-asm=CPU - Use zlib assembler sources optimized for specified CPU,valid values are: pentium,pentiumpro

--with-openssl=DIR - Set path to OpenSSL library sources

--with-openssl-opt=OPTIONS - Set additional options for OpenSSL building

--with-debug - 启用调试日志

--add-module=PATH - Add in a third-party module found in directory PATH

在不同版本间,选项可能会有些许变化,请总是使用 ./configure --help 命令来检查一下当前的选项列表。

使用技巧

对于chroot的支持是否在计划之中

在什么情况下使用Nginx比使用squid要好? 反之亦然。

大体上来说nginx主要用于反向加速代理而不是像squid那样作为常规代理服务器。Nginx的最大优势在于高负载情况下内存和CPU的低消耗。我不认为squid能给你带来比nginx更好的性能。

依照 [NginxImapProxyExample] 开始你的配置. 关于不同配置参数的具体信息,请查看 [NginxMailCoreModule] 页。

示例1: 用运行于apache上的php脚本做后端验证

示例2: 使用运行于同一个服务器的 nginx-embedded-perl模块作为 imap/pop代理和认证后端

某些东东不工作

(URL重写,代理,路径,...)

例如:如URL重写(rewrite)不工作了或者是unix的路径(/$PATH)的问题云云...

请仔细阅读 [NginxDebugging] 并且 逐行 查看错误日志。

如果你没找到错误 打起精神 试着到IRC或邮件列表里说明一下你碰到的问题。

有没有其它类似的Web服务器

Cherokee

Lighttpd (Lighty)

thttpd

关于各自的优缺点请使用自己喜欢的搜索引擎查找

让Nginx成为以postfix做为后端的SMTP代理

Nginx使用什么算法来实现负载均衡它能实现基于连接数的负载均衡吗?

Nginx使用简单的轮巡算法,所以无法做基本链接计数的负载均衡。这个可能会在将来的版本中有所改变。

我能关闭从代理服务器到后端服务器的缓存吗或者使用上传进度特性?

反向代理实践

. nginx + substitutions 安装

  nginx 自带一个Substitution模块,但该模块只能写一行,所以我们改用 substitutions

  下面是安装一些预备软件

yum -y --noplugins install wget zip

yum -y --noplugins install unzip

yum -y --noplugins install gcc

标签: