Hi there.
I'm hosting a OpenBSD mirror on my machine and my setup is http behind pf,
with relays via relay to expose it to outside.

since a while ago i have noticed the time pkg_add and other tools take is 
abnormal,
digging it i have found 
telecomm$ time ftp -o - -4 
http://telecomm.cloud9p.org/pub/OpenBSD/7.9/packages/amd64/index.txt
<snip>
999974 bytes received in 1.00 seconds (969.73 KB/s)
    1m00.19s real     0m00.03s user     0m00.02s system

(downloading from the same machine)

but i dont observe the same issue with curl:
telecomm$ time curl -q 
http://telecomm.cloud9p.org/pub/OpenBSD/7.9/packages/amd64/index.txt
<snip>
    0m00.29s real     0m00.00s user     0m00.05s system

i have tried with -current and 7.9-stable

directly connecting to httpd i dont see that issue either.

here is my relayd.conf:

# $OpenBSD: relayd.conf,v 1.6 2023/10/29 11:27:11 kn Exp $
lan_addr="100.64.11.1"
ext_addr="2.144.25.1"

log connection

table <lh> { 127.0.0.1 }
table <kiwix> { 127.0.0.1 }
table <enkiwix> { 127.0.0.1 }
table <null> { httpd }
table <www> { httpd }
table <got> { httpd }
table <radio> { 127.0.0.1 }
table <vc> { 127.0.0.1 }
table <authvc> { 127.0.0.1 }
table <webirc> { httpd }
table <mpgram> { 100.64.11.3 }
table <extwww> { $ext_addr }


http protocol httpr {
        match header set "X-Forwarded-For" value "$REMOTE_ADDR"
        match header set "X-Forwarded-By" value "$REMOTE_ADDR:$SERVER_PORT"

        match request header set "Connection" value "close"
        match request header "Upgrade" value "websocket" header set 
"Connection" value "upgrade"

        http websockets

        match request header "Host" value "*" forward to <www>
        match request header "Host" value "radio.cloud9p.org" forward to <radio>
        match request header "Host" value "git.cloud9p.org" forward to <got>
        match request header "Host" value "got.cloud9p.org" forward to <got>
        match request header "Host" value "*.docs.cloud9p.org" forward to <www>
        match request header "Host" value "telecomm.cloud9p.org" forward to 
<www>
        match request header "Host" value "cloud9p.org" forward to <www>
        match request header "Host" value "cloud9p.org" forward to <www>
        match request header "Host" value "vc.cloud9p.org" forward to <vc>
        match request header "Host" value "auth.vc.cloud9p.org" forward to 
<authvc>

        match request header "Host" value "archive.cloud9p.org" forward to 
<kiwix>
        match request header "Host" value "en.archive.cloud9p.org" forward to 
<kiwix>
        match request header "Host" value "mirror.cloud9p.org" forward to <www>
        match request header "Host" value "teledisk.cloud9p.org" forward to 
<www>


        match request url "archive.cloud9p.org/.well-known/acme-challenge/" 
forward to <www>
        match request url "en.archive.cloud9p.org/.well-known/acme-challenge/" 
forward to <www>
        match request url "radio.cloud9p.org/.well-known/acme-challenge/" 
forward to <www>
        match request url "vc.cloud9p.org/.well-known/acme-challenge/" forward 
to <www>
        match request url "auth.vc.cloud9p.org/.well-known/acme-challenge/" 
forward to <www>

        match request from 100.64.0.0/10 header "Host" value 
"irc.lan.cloud9p.org" forward to <webirc>
        match request url "share.cloud9p.org/uploads/" forward to <webirc>
}

http protocol httplan {
        match header set "X-Forwarded-For" value "$REMOTE_ADDR"
        match header set "X-Forwarded-By" value "$REMOTE_ADDR:$SERVER_PORT"
        match request header set "Connection" value "close"

        match request header "Host" value "*" forward to <extwww>
        match request header "Host" value "irc.lan.cloud9p.org" forward to 
<webirc>
        match request header "Host" value "irc.lan" forward to <webirc>

}

http protocol https {
        match request header append "X-Forwarded-For" value "$REMOTE_ADDR"
        match request header append "X-Forwarded-By" \
            value "$SERVER_ADDR:$SERVER_PORT"

        match header set "Connection" value "close"
        match request header "Upgrade" value "websocket" header set 
"Connection" value "upgrade"

        tls { keypair telecomm }
        http websockets

        match request header "Host" value "*" forward to <extwww>
        match request header "Host" value "irc.cloud9p.org" forward to <webirc>
        match request header "Host" value "vc.cloud9p.org" forward to <vc>
        match request header "Host" value "auth.vc.cloud9p.org" forward to 
<authvc>
        match request header "Host" value "mp.cloud9p.org" forward to <mpgram>
}

relay wwwtls {
        # Run as a TLS accelerator
        listen on $ext_addr port 443 tls
        protocol https

        forward to <extwww> port http
        forward to <mpgram> port 8000
}

relay www {
        listen on $ext_addr port http
        protocol httpr

        forward to <www> port http
        forward to <kiwix> port 8080
        forward to <got> port http
        forward to <radio> port 8000
        forward to <vc> port 8001
        forward to <authvc> port 8002
        forward to <webirc> port 9000
}

relay wwwlan {
        listen on $lan_addr port http
        protocol httplan

        forward to <webirc> port 9000
        forward to <extwww> port http
}


and here is my httpd.conf with some unrelated entries omited:
# $OpenBSD: httpd.conf,v 1.23 2025/02/21 10:19:52 mbuhl Exp $
types { include "/usr/share/misc/mime.types" }
prefork 8

server "null" {
        listen on httpd port 80
        log style forwarded

        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }
        location "*" {
                block return 403
        }
}

server "mirror.cloud9p.org" {
        listen on httpd port 80
        log style forwarded
        gzip-static

        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }

        root "/htdocs/pub"

        location "/*" {
                directory auto index
        }
}

server "telecomm.cloud9p.org" {
        alias "cloud9p.org"
        listen on httpd port 80
        gzip-static
        log style forwarded

        location "/.well-known/acme-challenge/*" {
                root "/acme"
                request strip 2
        }

        location match "/~([^/]*)(.+)" {
                block return 301 "/usr/%1%2"
                #request rewrite "/usr/%1%2"
        }
        location "/pub/*" {
                directory auto index
        }
        location "/usr/*/pub/*" {
                directory auto index
        }

        location "/doc/*" {
                block return 302 
"$REQUEST_SCHEME://telecomm.cloud9p.org/pub/docs/prosody$REQUEST_URI.html"
        }
}

any ideas?
-- 
chara <[email protected]>

Reply via email to