Resin多端口设置以及Nginx反向代理设置(转)

在resin中跑两个应用,分别是gd和qd,这两个应用使用的端口分别为:


gd:监视:6800 应用:8080
qd:监视:6801 应用:8081

则resin.xml主要配置如下:


<cluster id="gd">
    <server-default>
      <jvm-arg>-Xmx512m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-server</jvm-arg>
    </server-default>
        <resin:import path="${resin.home}/conf/app-default.xml"/>
    <server id="gd" address="127.0.0.1" port="6800">
        <http id="" port="8080"/>
    </server>
    <host id="" root-directory=".">
           <web-app id="/" root-directory="/data0/htdocs/gd/" />
    </host>
  </cluster>
 
  <cluster id="qd">
    <server-default>
      <jvm-arg>-Xmx512m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-server</jvm-arg>
    </server-default>
        <resin:import path="${resin.home}/conf/app-default.xml"/>
    <server id="qd" address="127.0.0.1" port="6801">
        <http id="" port="8081"/>
    </server>
    <host id="" root-directory=".">
           <web-app id="/" root-directory="/data0/htdocs/qd/"/>
    </host>
  </cluster>

则操作命令为:


./resin.sh restart|stop|start -server gd
./resin.sh restart|stop|start -server qd

另外gd和qd应用需要部署转发到80端口,各使用相应域名:
gd: gd.forzw.com
qd: qd.forzw.com

则在nginx中的配置为:


server
  {
  listen 80;
  server_name gd.forzw.com;
  index index.jsp index.html index.htm ;
  root /data0/htdocs/gd;
 
  if (-d $request_filename)
  {
  rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
  }
 
  location / {
  include /usr/local/webserver/nginx/conf/proxy_resin.conf;
  proxy_pass http://localhost:8080;
  proxy_set_header X-Real-IP $remote_addr;
  }
  }
 
  server
  {
  listen 80;
  server_name qd.forzw.com;
  index index.jsp index.html index.htm ;
  root /data0/htdocs/qd;
 
  if (-d $request_filename)
  {
  rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
  }
 
  location / {
  include /usr/local/webserver/nginx/conf/proxy_resin.conf;
  proxy_pass http://localhost:8081;
  proxy_set_header X-Real-IP $remote_addr;
 
  }
  }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值