[GH-ISSUE #552] Enable HTTP/2 for ntfy.sh #420

Closed
opened 2026-05-07 00:23:59 +02:00 by BreizhHardware · 8 comments

Originally created by @otbutz on GitHub (Dec 21, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/552

Any reason that https://ntfy.sh is limited to HTTP/1.1 ?

Originally created by @otbutz on GitHub (Dec 21, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/552 Any reason that https://ntfy.sh is limited to HTTP/1.1 ?
Author
Owner

@binwiederhier commented on GitHub (Dec 22, 2022):

Good question. No particular reason, other than I have never set that up for nginx. I could probably do it. Do you happen to have experience with that @otbutz?

Here's how it's set up: https://github.com/binwiederhier/ntfy-ansible/blob/main/roles/nginx/templates/sites-available/ntfy.j2

<!-- gh-comment-id:1362306296 --> @binwiederhier commented on GitHub (Dec 22, 2022): Good question. No particular reason, other than I have never set that up for nginx. I could probably do it. Do you happen to have experience with that @otbutz? Here's how it's set up: https://github.com/binwiederhier/ntfy-ansible/blob/main/roles/nginx/templates/sites-available/ntfy.j2
Author
Owner

@binwiederhier commented on GitHub (Dec 22, 2022):

Looks like it's just adding the http2 stanza: https://ubiq.co/tech-blog/how-to-enable-http2-in-nginx/

Maybe I'll yolo-deploy that tomorrow and see what happens.

<!-- gh-comment-id:1362317662 --> @binwiederhier commented on GitHub (Dec 22, 2022): Looks like it's just adding the `http2` stanza: https://ubiq.co/tech-blog/how-to-enable-http2-in-nginx/ Maybe I'll yolo-deploy that tomorrow and see what happens.
Author
Owner

@otbutz commented on GitHub (Dec 22, 2022):

I would follow Mozillas best practices and also enable TLS1.3 while you're at it:

https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=intermediate&openssl=1.1.1k&hsts=false&ocsp=false&guideline=5.6 (You should really consider to ditch HTTP and enforce HTTPS with HSTS.)

You could also switch to caddy if you're feeling adventurous and get HTTP/3 support 😉

<!-- gh-comment-id:1362536305 --> @otbutz commented on GitHub (Dec 22, 2022): I would follow Mozillas best practices and also enable TLS1.3 while you're at it: https://ssl-config.mozilla.org/#server=nginx&version=1.17.7&config=intermediate&openssl=1.1.1k&hsts=false&ocsp=false&guideline=5.6 (You should really consider to ditch HTTP and enforce HTTPS with HSTS.) You could also switch to caddy if you're feeling adventurous and get HTTP/3 support :wink:
Author
Owner

@binwiederhier commented on GitHub (Dec 22, 2022):

I would follow Mozillas best practices and also enable TLS1.3 while you're at it

Sure why not.

You should really consider to ditch HTTP and enforce HTTPS with HSTS

Nope. That prevents the awesome curl -d hi ntfy.sh/yo usage. Don't wanna type https:// all the time, and I am usually not fearing MITM or sharing state secrets. If people are, they can set up their own server.

You could also switch to caddy if you're feeling adventurous and get HTTP/3 support wink

If it ain't broke, don't fix it. :-D

<!-- gh-comment-id:1362686732 --> @binwiederhier commented on GitHub (Dec 22, 2022): > I would follow Mozillas best practices and also enable TLS1.3 while you're at it Sure why not. > You should really consider to ditch HTTP and enforce HTTPS with HSTS Nope. That prevents the awesome `curl -d hi ntfy.sh/yo` usage. Don't wanna type `https://` all the time, and I am usually not fearing MITM or sharing state secrets. If people are, they can set up their own server. > You could also switch to caddy if you're feeling adventurous and get HTTP/3 support wink If it ain't broke, don't fix it. :-D
Author
Owner

@otbutz commented on GitHub (Dec 22, 2022):

That should still work without https:// if you allow curl to follow redirects:

curl -L -d hi ntfy.sh/yo
<!-- gh-comment-id:1362697643 --> @otbutz commented on GitHub (Dec 22, 2022): That should still work without https:// if you allow curl to follow redirects: ```sh curl -L -d hi ntfy.sh/yo ```
Author
Owner

@binwiederhier commented on GitHub (Dec 23, 2022):

See https://github.com/binwiederhier/ntfy-ansible/pull/1

<!-- gh-comment-id:1363604391 --> @binwiederhier commented on GitHub (Dec 23, 2022): See https://github.com/binwiederhier/ntfy-ansible/pull/1
Author
Owner

@binwiederhier commented on GitHub (Dec 23, 2022):

Sadly the Unix socket change causes a (benign) warning in the ntfy code for every single request (r.RemoteAddr now contains @, instead of an IP address), which means I need a small code change to handle that case. Otherwise I'd get flooded in warnings.

<!-- gh-comment-id:1363605427 --> @binwiederhier commented on GitHub (Dec 23, 2022): Sadly the Unix socket change causes a (benign) warning in the ntfy code for every single request (`r.RemoteAddr` now contains `@`, instead of an IP address), which means I need a small code change to handle that case. Otherwise I'd get flooded in warnings.
Author
Owner

@otbutz commented on GitHub (Dec 23, 2022):

Shouldn't the remote address not be populated from X-Forwarded-For header in this case?

<!-- gh-comment-id:1363777321 --> @otbutz commented on GitHub (Dec 23, 2022): Shouldn't the remote address not be populated from `X-Forwarded-For` header in this case?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#420
No description provided.