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 ---------------------------------------------------------------------
Your current IP address is: 35.171.182.239
Your IP address location: 美国弗吉尼亚阿什本
Your IP address country and region: 美国 美国
Your current browser is:
Your current system is:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source http://myzhenai.com/post/3207.html

没有评论

发表回复

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