bianbian coding life

便便代码人生: 关注技术, 翻译文档, 偶尔动动手

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

Posted by bianbian on 2007-04-05 07:11

本文Tags: ,

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;
}

标签: ,

遵守创作共用协议,转载请链接形式注明来自http://bianbian.org 做人要厚道

相关日志

2 Responses to “[原]安装nginx作为web服务器及反向代理”

  1. Moustique Says:

    Hi,看到你这篇blog想问你一个关于反向代理的问题。
    我现在使用squid和apache做公司里OWA (Outlook Web Access)的反向代理,试用下来只有一个问题,就是如果email的subject中包含百分号%的话,反向代理就会报页面错误。你碰到过这种情况吗?

  2. ngwsx Says:

    欢迎使用nginx的Windows移植版ngwsx,
    当前版本支持处理静态文件,反向代理,FastCGI请求。

    博客:http://blog.csdn.net/ngwsx/
    下载:http://download.csdn.net/source/390623

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

(required)