hostsplitter: HTTP反向代理和負載平衡器

jopen 8年前發布 | 16K 次閱讀 集群/負載均衡

HostSplitter

HostSplitter是一個HTTP反向代理和負載平衡器,它將基于主機頭將請求分發至任意數量的網站

Motivation

I commonly run into an issue developing small golang websites: I want to use the same IP address for many sites that aren't large enough to justify their own server.

Site files

HostSplitter will look for site files by default in "/etc/hostsplitter/". HostSplitter will only read files with the .json extension.

A each site file should look like

{
    "hostnames": [
        "ammar.io",
        "www.ammar.io"
    ],
    "backends": [
        "127.0.0.1:9000"
    ],
    "secret": "puppies1234"
}

The "secret" field is passed along with every request to that site in the X-Hostsplitter-Secret header. This is intended to be checked before trusting the passed along IP.

Real IP

The original requester's IP is located in the X-Forwarded-For header.

Reloading

HostSplitter provides 0 downtime reload functionality via SIGUSR1. E.g

pkill -10 hostsplitter

Roadmap

  • SSL

項目地址: https://github.com/ammario/hostsplitter

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!