nixos/solitary: Prioritise HTTP requests

This commit is contained in:
Mikael 2024-10-19 19:20:43 +02:00
parent c1e63dcc86
commit 857753d9fa
Signed by: mikael
SSH key fingerprint: SHA256:21QyD2Meiot7jOUVitIR5YkGB/XuXdCvLW1hE6dsri0

View file

@ -343,6 +343,7 @@ in {
acl host-resolve hdr(host),host_only resolve.solitary.social acl host-resolve hdr(host),host_only resolve.solitary.social
acl path-acme path_reg ^/\.well-known/acme-challenge(/.*)?$ acl path-acme path_reg ^/\.well-known/acme-challenge(/.*)?$
acl path-well-known path_beg /.well-known/
acl path-security.txt path /.well-known/security.txt acl path-security.txt path /.well-known/security.txt
acl path-matrix-well-known path_reg ^/\.well-known/matrix(/.*)?$ acl path-matrix-well-known path_reg ^/\.well-known/matrix(/.*)?$
acl path-proxy path_reg ^/proxy(/.*)?$ acl path-proxy path_reg ^/proxy(/.*)?$
@ -359,13 +360,19 @@ in {
http-request redirect scheme https code 301 unless { ssl_fc } or path-acme http-request redirect scheme https code 301 unless { ssl_fc } or path-acme
http-request wait-for-handshake unless replay-safe http-request wait-for-handshake unless replay-safe
http-response set-tos 20 if path-acme # AF22 (lowlatency, med drop) http-request set-priority-class int(-1) if host-resolve
http-request set-priority-class int(1) if host-solitary
http-request set-priority-class int(2) if host-media
http-request set-priority-class int(3) if host-cache
http-request set-priority-class int(-2) if path-well-known
http-response set-tos 20 if host-resolve # AF22 (lowlatency, med drop) http-response set-tos 20 if host-resolve # AF22 (lowlatency, med drop)
http-response set-tos 10 if host-matrix # AF11 (highthroughput, low drop) http-response set-tos 10 if host-matrix # AF11 (highthroughput, low drop)
http-response set-tos 10 if host-syncv3 # AF11 (highthroughput, low drop) http-response set-tos 10 if host-syncv3 # AF11 (highthroughput, low drop)
http-response set-tos 12 if host-solitary # AF12 (highthroughput, med drop) http-response set-tos 12 if host-solitary # AF12 (highthroughput, med drop)
http-response set-tos 14 if host-media # AF13 (highthroughput, high drop) http-response set-tos 14 if host-media # AF13 (highthroughput, high drop)
http-response set-tos 14 if host-cache # AF13 (highthroughput, high drop) http-response set-tos 14 if host-cache # AF13 (highthroughput, high drop)
http-response set-tos 20 if path-well-known # AF22 (lowlatency, med drop)
http-request cache-use default http-request cache-use default
http-request set-header X-Forwarded-Proto %[ssl_fc,iif(https,http)] http-request set-header X-Forwarded-Proto %[ssl_fc,iif(https,http)]