From 04713bb59f5ddf7daa94555d23a527b31864d71a Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 7 May 2022 02:40:37 +0900 Subject: Enable IPFS gateway --- configuration.nix | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'configuration.nix') diff --git a/configuration.nix b/configuration.nix index 0fa2b44..414af1a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -52,20 +52,34 @@ in { }; services = { + ipfs = { + enable = true; + enableGC = true; + extraConfig.GateWay = { + NoFetch = true; + PublicGateways.${domain} = { + Paths = [ "/ipfs" "/ipns" ]; + UseSubdomains = true; + }; + }; + }; + nginx = { enable = true; + recommendedProxySettings = true; virtualHosts.${domain} = { enableACME = true; forceSSL = true; - root = "/var/www/${domain}"; + locations = let + ipfsGateway = "http://localhost:8080"; + in { + "/ipfs".proxyPass = ipfsGateway; + "/ipns".proxyPass = ipfsGateway; + }; + root = "/var/lib/www/${domain}"; }; }; - ipfs = { - enable = true; - enableGC = true; - }; - openssh = { enable = true; passwordAuthentication = false; -- cgit 1.4.1