lighttpd 将目录代理到另一台服务器

发布于 2025-01-06 04:13:19 字数 300 浏览 2 评论 0原文

/etc/lighttpd/vhosts

$HTTP["url"] =~ "^/sr/" {
    proxy.server = (
        "" => ( (
            "host" => "x.x.x.x",
            "port" => 80
        ) )
    )
}

mod_proxy - 启用 但什么也没发生,example.com/sr/ 转发到第一台服务器上的 404 页面

in /etc/lighttpd/vhosts

$HTTP["url"] =~ "^/sr/" {
    proxy.server = (
        "" => ( (
            "host" => "x.x.x.x",
            "port" => 80
        ) )
    )
}

mod_proxy - enabled
but nothing hapends, example.com/sr/ forward to 404 page on first server

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万劫不复 2025-01-13 04:13:19

您的 $HTTP["url"] =~ "^/sr/" { 是否位于 $HTTP["host"] 子句内?

你有没有尝试过:

$HTTP["host"] =~ "(^sample.com)$" {
  proxy.server = (
      "/sr/" => ( (
          "host" => "x.x.x.x",
          "port" => 80
      ) )
  )
}

Is your $HTTP["url"] =~ "^/sr/" { inside a $HTTP["host"] clause ?

Have you tried:

$HTTP["host"] =~ "(^sample.com)$" {
  proxy.server = (
      "/sr/" => ( (
          "host" => "x.x.x.x",
          "port" => 80
      ) )
  )
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文