Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
basncy
V2EX  ›  云计算

matrix homeserver 大陸分流加速

  •  
  •   basncy · Nov 25, 2023 · 2480 views
    This topic created in 922 days ago, the information mentioned may be changed or developed.
    Homeserver 建在海外,大陸用戶連大陸中轉, 海外用戶(主要是 federation 之間的連接)連海外.

    nginx geo 模塊分流配置舉例:
    http{
    geoip_country /usr/share/GeoIP/GeoIPv6.dat;
    server {
    location /.well-known/matrix/server {
    if ( $geoip_country_code = CN ) {
    return 200 '{"m.server": "cn-vps.example.com:12345"}';
    }
    return 200 '{"m.server": "homeserver.example.com:12345"}';
    }
    location /.well-known/matrix/client 類似
    }

    cn-vps.example.com:12345 加速方法省略幾萬字, nginx 舉例:
    location / alias /usr/share/webapps/element/; #國內 element-web client 加速
    location /_matrix/ proxy_pass http://10.0.8.2:8008 synapse 服務器.
    3 replies    2023-11-26 15:06:02 +08:00
    hrong
        1
    hrong  
       Nov 25, 2023 via iPhone
    没看懂在说啥
    basncy
        2
    basncy  
    OP
       Nov 25, 2023
    @hrong 就是自建 matrix homeserver, 国内用户走国内入口, 国外用户走国外入口. 跨境部分用 nginx 反代加速举例.
    hrong
        3
    hrong  
       Nov 26, 2023 via iPhone
    就是一个聊天服务器呗。那你前置写两句话不是更好吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5795 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 346ms · UTC 02:53 · PVG 10:53 · LAX 19:53 · JFK 22:53
    ♥ Do have faith in what you're doing.