Add trailing slash to strip path
Nginx strips the path on a reverse proxy route if you add a trailing slash. By
missing out our trailing slashes, reverse proxy routes inside path directives
were failing for missing paths. This commit fixes that issue, fixing the Nucleus
API
Change-Id: I1532c6acfcb3b3969e7bb4af229e4321bc78cdd6
diff --git a/nginx.nix b/nginx.nix
index c6417fc..a5e502c 100644
--- a/nginx.nix
+++ b/nginx.nix
@@ -106,7 +106,7 @@
else if service.type == "reverseproxy" then
(lib.recursiveUpdate currentConfig {
value.locations.${currentPath} = {
- proxyPass = "http://${service.to}";
+ proxyPass = if currentPath == "/" then "http://${service.to}" else "http://${service.to}/";
proxyWebsockets = true;
recommendedProxySettings = true;
};