summaryrefslogtreecommitdiff
path: root/modules/nixfiles/ipfs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixfiles/ipfs.nix')
-rw-r--r--modules/nixfiles/ipfs.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/nixfiles/ipfs.nix b/modules/nixfiles/ipfs.nix
index 455f8e8..8bdbc12 100644
--- a/modules/nixfiles/ipfs.nix
+++ b/modules/nixfiles/ipfs.nix
@@ -134,8 +134,13 @@ in {
(mkIf this.isHeadless {
nixfiles.modules.nginx = {
enable = true;
+ upstreams = {
+ ipfs_gateway.servers."127.0.0.1:${toString cfg.gatewayPort}" = {};
+ ipfs_swarm.servers."127.0.0.1:${toString cfg.swarmPort}" = {};
+ ipfs_api.servers."127.0.0.1:${toString cfg.apiPort}" = {};
+ };
virtualHosts = {
- ${cfg.domain}.locations."/".proxyPass = "http://127.0.0.1:${toString cfg.gatewayPort}";
+ ${cfg.domain}.locations."/".proxyPass = "http://ipfs_gateway";
"swarm.${cfg.domain}" = {
serverName = cfg.domain;
listen = [
@@ -148,12 +153,12 @@ in {
port = swarmDefaultPort;
}
];
- locations."/".proxyPass = "http://127.0.0.1:${toString cfg.swarmPort}";
+ locations."/".proxyPass = "http://ipfs_swarm";
};
"api.${cfg.domain}" = {
# TODO Redirect "/" to "/webui" but keep other endpoints.
locations."/" = {
- proxyPass = "http://127.0.0.1:${toString cfg.apiPort}";
+ proxyPass = "http://ipfs_api";
extraConfig = ''
if ($internal != 1) {
return 403;