[GH-ISSUE #168] SWAG reverse proxy config push request. #138

Closed
opened 2026-05-07 00:20:26 +02:00 by BreizhHardware · 5 comments

Originally created by @sudo-kraken on GitHub (Mar 14, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/168

This guide assumes you are using a working SWAG setup from Linux Server IO and want to add the Nfty service to your domain for external access. Below is the conf file that I use, if should be placed in your mount point of /config/nginx/proxy-confs and named nfty.subdomain.conf so that swag picks it up, the name is irrelevant but it must be in this folder with the .conf file extension.

This will run Ntfy on a subdomain called Ntfy, in the case below you need to update the IP address of the Nfty server for this example I have chosen the IP 10.0.10.10 and the port that http is bound on to 1111.

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name ntfy.*;

    include /config/nginx/ssl.conf;
#    include /config/nginx/authelia-server.conf;

    location / {
        include /config/nginx/proxy.conf;
#        include /config/nginx/authelia-location.conf;

        proxy_buffering off;
        proxy_request_buffering off;

        set $upstream_app  10.0.10.10;
        set $upstream_port 1111;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        client_max_body_size 20m; # Must be >= attachment-file-size-limit in /etc/ntfy/server.yml

    }

}

Let me know if you need any more info for the documentation.

Originally created by @sudo-kraken on GitHub (Mar 14, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/168 This guide assumes you are using a working SWAG setup from Linux Server IO and want to add the Nfty service to your domain for external access. Below is the conf file that I use, if should be placed in your mount point of /config/nginx/proxy-confs and named nfty.subdomain.conf so that swag picks it up, the name is irrelevant but it must be in this folder with the .conf file extension. This will run Ntfy on a subdomain called Ntfy, in the case below you need to update the IP address of the Nfty server for this example I have chosen the IP 10.0.10.10 and the port that http is bound on to 1111. ``` server { listen 443 ssl; listen [::]:443 ssl; server_name ntfy.*; include /config/nginx/ssl.conf; # include /config/nginx/authelia-server.conf; location / { include /config/nginx/proxy.conf; # include /config/nginx/authelia-location.conf; proxy_buffering off; proxy_request_buffering off; set $upstream_app 10.0.10.10; set $upstream_port 1111; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; client_max_body_size 20m; # Must be >= attachment-file-size-limit in /etc/ntfy/server.yml } } ``` Let me know if you need any more info for the documentation.
Author
Owner

@binwiederhier commented on GitHub (Mar 16, 2022):

Looks like SWAG is just like nginx. I don't see any additional parameters that's not already in the docs. Thank you for providing these!

<!-- gh-comment-id:1069475854 --> @binwiederhier commented on GitHub (Mar 16, 2022): Looks like SWAG is just like nginx. I don't see any additional parameters that's not already in the docs. Thank you for providing these!
Author
Owner

@SuperSandro2000 commented on GitHub (Oct 19, 2022):

Why is proxy_buffering and proxy_request_buffering disabled? According to 10 common nginx mistakes proxy_buffering should not be disabled.

<!-- gh-comment-id:1284612186 --> @SuperSandro2000 commented on GitHub (Oct 19, 2022): Why is proxy_buffering and proxy_request_buffering disabled? According to 10 common nginx mistakes proxy_buffering should not be disabled.
Author
Owner

@binwiederhier commented on GitHub (Oct 19, 2022):

Because if you upload a larger file slowly the backend will time out. Iirc

<!-- gh-comment-id:1284624299 --> @binwiederhier commented on GitHub (Oct 19, 2022): Because if you upload a larger file slowly the backend will time out. Iirc
Author
Owner

@SuperSandro2000 commented on GitHub (Oct 19, 2022):

Please take a look at https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#proxy_buffering-off . I think we should rather increase the timeout for uploads or rework them to send 100s between rather than disabling this option.

<!-- gh-comment-id:1284627049 --> @SuperSandro2000 commented on GitHub (Oct 19, 2022): Please take a look at https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#proxy_buffering-off . I think we should rather increase the timeout for uploads or rework them to send 100s between rather than disabling this option.
Author
Owner

@binwiederhier commented on GitHub (Oct 21, 2022):

ntfy does not ship with an nginx config; it merely suggests one in the docs. I am happy to accept PRs against the docs if this is important to you. However, I do recall reasons for why buffering was disabled in the first place, and we'd have to do testing with the other settings. All I can say is it works.

That said, I do think a proxy should be a passthrough, and not smart like that. Buffering is certainly unexpected from a user perspective IMHO.

<!-- gh-comment-id:1287057587 --> @binwiederhier commented on GitHub (Oct 21, 2022): ntfy does not ship with an nginx config; it merely suggests one in the docs. I am happy to accept PRs against the docs if this is important to you. However, I do recall reasons for why buffering was disabled in the first place, and we'd have to do testing with the other settings. All I can say is it works. That said, I do think a proxy should be a passthrough, and not smart like that. Buffering is certainly unexpected from a user perspective IMHO.
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#138
No description provided.