[GH-ISSUE #1653] Documentation: Caddyfile simplification #1155

Open
opened 2026-05-07 00:30:39 +02:00 by BreizhHardware · 0 comments

Originally created by @pdc1 on GitHub (Mar 13, 2026).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1653

💡 Idea

I'm implementing support for reverse proxy using caddy, and I think it would help to simplify the config to split the https and http, like so:

ntfy.sh {
    reverse_proxy 127.0.0.1:2586
}

http://ntfy.sh {
    # Redirect HTTP to HTTPS, but only for GET topic addresses, since we want
    # it to work with curl without the annoying https:// prefix
    @httpget {
        method GET
        path_regexp ^/([-_a-z0-9]{0,64}$|docs/|static/)
    }

    redir @httpget https://{host}{uri}
    reverse_proxy 127.0.0.1:2586
}

I'm also not sure how necessary the regex is, but I will defer to your judgment there. I am trying an experiment without it since curl with http would use POST (e.g. curl -d "hello" http://ntfy.lan/mytopic) so redirect everything else (e.g. GET). Initial testing without the regex looks good so far...

💻 Target components
Documentation.

Originally created by @pdc1 on GitHub (Mar 13, 2026). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1653 :bulb: **Idea** I'm implementing support for reverse proxy using caddy, and I think it would help to simplify the config to split the https and http, like so: ```caddyfile ntfy.sh { reverse_proxy 127.0.0.1:2586 } http://ntfy.sh { # Redirect HTTP to HTTPS, but only for GET topic addresses, since we want # it to work with curl without the annoying https:// prefix @httpget { method GET path_regexp ^/([-_a-z0-9]{0,64}$|docs/|static/) } redir @httpget https://{host}{uri} reverse_proxy 127.0.0.1:2586 } ``` I'm also not sure how necessary the regex is, but I will defer to your judgment there. I am trying an experiment without it since curl with http would use POST (e.g. `curl -d "hello" http://ntfy.lan/mytopic`) so redirect everything else (e.g. GET). Initial testing without the regex looks good so far... :computer: **Target components** Documentation.
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#1155
No description provided.