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
俄语,不要紧,最上面那个就是最新的。
下载解压安装:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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; } |