lighttpd反向代理设置办法

2020年03月31日

两种方法,可以根据自己情况来使用,但是根据网友所说,lighttpd的反代作用并不比nginx强。

在 /etc/lighttpd/vhosts (直接在lighttpd伪静态规则里添加)里加入
$HTTP["host"] =~ "(^sample.com)$" {
  proxy.server = (
      "/sr/" => ( (
          "host" => "x.x.x.x",
          "port" => 80
      ) )
  )
}

 

$HTTP["url"] =~ "^/webmail" {
    # add host header
    setenv.add-request-header ( "Host" => "example2.org" )

    proxy.server =  ("/webmail/" => (
        # this entry should link to example2.org
        ("host" => "1.2.3.4", "port" => 80)
    ))
}

 

lighttpd开启多端口访问的方法

$SERVER["socket"] == "ip:port" {

        }

 
有几个端口加几个


sicnature ---------------------------------------------------------------------
I P 地 址: 3.12.71.34
区 域 位 置: 美国俄亥俄都柏林
系 统 信 息: 美国
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://www.myzhenai.com/post/3207.html

没有评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注