summaryrefslogtreecommitdiff
path: root/modules/nixfiles/gotify.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixfiles/gotify.nix')
-rw-r--r--modules/nixfiles/gotify.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/nixfiles/gotify.nix b/modules/nixfiles/gotify.nix
index 440aff8..1cfd9a7 100644
--- a/modules/nixfiles/gotify.nix
+++ b/modules/nixfiles/gotify.nix
@@ -23,11 +23,15 @@ in {
nixfiles.modules = {
nginx = {
enable = true;
- virtualHosts.${cfg.domain} = {
- locations."/" = {
- proxyPass = "http://127.0.0.1:${toString config.services.gotify.port}";
- proxyWebsockets = true;
- };
+ upstreams.gotify.servers."127.0.0.1:${toString config.services.gotify.port}" = {};
+ virtualHosts.${cfg.domain}.locations."/" = {
+ proxyPass = "http://gotify";
+ proxyWebsockets = true;
+ extraConfig = ''
+ if ($internal != 1) {
+ return 403;
+ }
+ '';
};
};
postgresql.enable = true;