Anthony Accioly on Nostr: πππ: When acting as a reverse proxy, Nginx uses HTTP/1.0 and doesnβt ...
πππ: When acting as a reverse proxy, Nginx uses HTTP/1.0 and doesnβt enable πππππππππ (HTTP persistent connections) to upstream servers by default. My reverse proxy was happily responding to clients using HTTP/1.1 or HTTP/2.0 while still using HTTP/1.0 to connect to my personal relay.
I didnβt think it would make much of a difference, given that Nostr is WebSocket-basedβi.e., HTTP connections are quickly upgraded with:
π²πππππππππ:βπππππππ
πππππππ:βπ ππππππππ
Plus, my personal relay isnβt exactly handling a lot of traffic.
Nevertheless, configuring a small number of cached connections apparently reduced CPU usage, not only for Nginx but also for Haven itself. The more you know...
Iβve enabled persistent connections for Nginx on my Haven repo and merged
girinovey (npub18laβ¦cfsz)'s latest contribution from upstream. Do let me know if you encounter any issues.
https://www.f5.com/company/blog/nginx/avoiding-top-10-nginx-configuration-mistakes#no-keepalives#Haven #Nginx #HTTP #ReverseProxy #WebSockets #Nostr
Published at
2024-11-15 23:52:09Event JSON
{
"id": "2d66faf29098a8f42681fa1ca2ba7c4d5039f3e5430c42e8b13603d0f4a90da9",
"pubkey": "ee9d979e7e1418a9f7472baf82dc96082a0d4251b77bcb170a6ecec93fadff64",
"created_at": 1731714729,
"kind": 1,
"tags": [
[
"t",
"haven"
],
[
"t",
"nginx"
],
[
"t",
"http"
],
[
"t",
"reverseproxy"
],
[
"t",
"websockets"
],
[
"t",
"nostr"
],
[
"p",
"3ffac3a6c859eaaa8cdddb2c7002a6e10b33efeb92d025b14ead6f8a2d656657",
"",
"mention"
],
[
"client",
"noStrudel",
"31990:266815e0c9210dfa324c6cba3573b14bee49da4209a9456f9484e5106cd408a5:1686066542546"
]
],
"content": "πππ: When acting as a reverse proxy, Nginx uses HTTP/1.0 and doesnβt enable πππππππππ (HTTP persistent connections) to upstream servers by default. My reverse proxy was happily responding to clients using HTTP/1.1 or HTTP/2.0 while still using HTTP/1.0 to connect to my personal relay.\n\nI didnβt think it would make much of a difference, given that Nostr is WebSocket-basedβi.e., HTTP connections are quickly upgraded with:\n\nπ²πππππππππ:βπππππππ \nπππππππ:βπ ππππππππ\n\nPlus, my personal relay isnβt exactly handling a lot of traffic.\n\nNevertheless, configuring a small number of cached connections apparently reduced CPU usage, not only for Nginx but also for Haven itself. The more you know...\n\nIβve enabled persistent connections for Nginx on my Haven repo and merged nostr:npub18lav8fkgt8424rxamvk8qq4xuy9n8mltjtgztv2w44hc5tt9vets0hcfsz's latest contribution from upstream. Do let me know if you encounter any issues.\n\nhttps://www.f5.com/company/blog/nginx/avoiding-top-10-nginx-configuration-mistakes#no-keepalives\n\n#Haven #Nginx #HTTP #ReverseProxy #WebSockets #Nostr",
"sig": "126d30577e9a4652115fb0f4716d067b20ecbb93411b0c9767d18720bba5793b25e5dcbcdcb00375c4d1216ff5d84db975223f806a2eadfea37b7b68a42e8690"
}