nginx + resin搭建

一:安装nginx

nginx安装请参考:http://qingshuis.iteye.com/admin/blogs/1959967

 

二:安装resin

 

1:选定源码目录

可以是任何目录,本文选定的是/works

cd /works

 

2:安装resin

wget http://www.caucho.com/download/resin-3.0.23.tar.gz

tar -vzxf resin -3.0.23.tar.gz  到你想放置的目录

cd resin-3.0.23

./configure

make

make install 

 

3:修改端口号

端口号修改:/works/resin-3.0.23/conf/resin.conf

默认8080,可修改

 

4:启动resin

works/resin-3.0.23/bin/http.sh start

浏览器中输入host:端口,能打开resin欢迎界面说明resin配置成功

 

 

5:整合nginx, resin

使用nginx的proxy功能,将请求转发给resin

修改nginx的配置文件nginx.conf

 

 程序代码

server {

        listen       80;

        server_name  www.qinghuis.com;

 

        error_page   500 502 503 504  /50x.html;

        location = /50x.html {

            root   html;

        }

 

 

        location / {

             access_log on;

             proxy_pass http://127.0.0.1:8082;

             proxy_set_header X-Real-IP $remote_addr;                                                             

             proxy_set_header Host $host;                                                                         

             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                              client_max_body_size    10m;                                                                         

             client_body_buffer_size 128k;                                                                        

        }       

}        

 

修改配置后重启nginx,访问nginx则会跳转至resin欢迎页

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值