安装nginx作为web服务器及反向代理

Posted in Web by neemem on 06-20-2008.

[engine x] is an HTTP(S) , HTTP(S) reverse proxy and IMAP/POP3 proxy written by Igor Sysoev. It has been running on many heavily loaded Russian sites for more than two years.
俄罗斯人写的,我总觉得俄罗斯都是高手。。。。再仔细看了一下(所有能看懂的文档),基于事件的,对小文件的读写性能很好,也更适合做反向代理( 》Squid 》Apache),更适合BBS的情况。所以决定装这个。
http://sysoev.ru//download.
俄语,不要紧,最上面那个就是最新的。
下载解压安装:

tar zxf -x.x.x.tar.gz
cd -x.x.x
./configure --prefix=/opt/ --with-http_realip_module
make
make install
这样配置文件在/opt//conf/.conf
cd /opt/
vim conf/.conf
配置文件格式有点像lighttpd,其实你熟悉的话应该很容易看懂。
我修改的内容:
反向代理:
location / {
proxy_pass http://localhost:8000/;
proxy_set_header X-Real-IP $remote_addr;
}
#禁止下载所有.开头的文件名,如 .DIR
location ~ /\..+ {
deny all;
}

Related posts:
UCWEB iphone测试版发布(080620) 第一时间发布 nginx配置的修改

Leave a Reply