mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #936] Configuring Ntfy with Nginx as a Reverse Proxy: Seeking Assistance #655
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#655
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @YezGotIt on GitHub (Nov 1, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/936
❓ Question
How can I configure Ntfy with Nginx as a reverse proxy? I've tried following the documentation on ntfy.sh but haven't been successful.
And one more thing, I added Cloudflare Tunnel access to the notification service from the public.
@bear commented on GitHub (Nov 2, 2023):
What part of the current nginx examples are you curious about? Most of what is contained in them are stock nginx items for proxying a web server while terminating SSL with all of the normal production level items covered.
Where are you having trouble? Do you see the ntfy service receiving traffic? I do know that starting the service standalone was more useful for debugging as it allowed me to see the trace and debug logs more easier
@YezGotIt commented on GitHub (Nov 2, 2023):
This is my setup:
I will attach the nginx error.log file. Here is the nginx configuration file, default.conf.txt
@YezGotIt commented on GitHub (Nov 2, 2023):
If I visit the domain...
This is happening.
If I connect with the localhost IP, such as 10.8.x.x, it works, but not with the actual domain name.

@bear commented on GitHub (Nov 4, 2023):
A couple of small items first, for your server port 80, you are only going to redirect so you don't need to have any proxy_pass items in it. Those are really being ignored but it helps to be explicit with nginx configs IMO
If you are redirecting all of your port 80 to 443, you can take advantage of some nginx config items - the following tells nginx that the server block is the default for port 80 and that it matches all server names (that's the _ bit). It also uses a simpler "pass on the rest of the URI" method that avoids all of the args and query param junk
Let me know if you have any questions about this change - it's what I have discovered works well when you get the dreaded too many redirects issue.
@YezGotIt commented on GitHub (Nov 4, 2023):
You can check it here: https://demo.ygi.li/. + Cloudflare tunnel
Here is the configuration:
Still same error.
@binwiederhier commented on GitHub (Nov 17, 2023):
Feel free to join the Discord or Matrix chat if you're still experiencing issues.