安装nginx作为web服务器及反向代理
Posted in Web by neemem on 06-20-2008.Nginx [engine x] is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server written by Igor Sysoev. It has been running on many heavily loaded Russian sites for more than two years.
俄罗斯人写的,我总觉得俄罗斯都是高手。。。。再仔细看了一下(所有能看懂的文档),基于事件的,对小文件的读写性能很好,也更适合做反向代理(nginx 》Squid 》Apache),更适合BBS的情况。所以决定装这个。
http://sysoev.ru/nginx/download.html
俄语,不要紧,最上面那个就是最新的。
下载解压安装:
tar zxf nginx-x.x.x.tar.gz
cd nginx-x.x.x
./configure --prefix=/opt/nginx --with-http_realip_module
make
make install
这样配置文件在/opt/nginx/conf/nginx.conf
cd /opt/nginx
vim conf/nginx.conf
配置文件格式有点像lighttpd,其实你熟悉JavaScript或JSON的话应该很容易看懂。
我修改的内容:
反向代理:
location / {
proxy_pass http://localhost:8000/;
proxy_set_header X-Real-IP $remote_addr;
}
#禁止下载所有.开头的文件名,如 .DIR
location ~ /\..+ {
deny all;
}
- nginx+apache+mysql+php+memcached+squid搭建门户网站
- Apache vs Nginx : Web Server Performance Deathmatch
- 优化squid性能
- Nginx 0.5.33 + PHP 5.2.5(FastCGI)Web服务器
- nginx初试及apache对比测试
- WEB标准网页布局中HTML结构化漫谈
- Linux / Android on HTC Diamond
- Linux on Raphael and Diamond (maybe Android)
- Manila Customizer - Customize Clocks, Icons, Sliders etc
- WM能玩双系统? TyTN II跑Android
