Browse Source

rails: Make nginx location unique, proxy to puma over IPv4

  * Replace the @app location with a unique ID generated from the
    Rails application name

  * Puma is currently only listening on IPv4 so having nginx proxy to
    localhost wasted a connection to ::1.  The proxy address is now to
    127.0.0.1 to keep that from happening.
pjones/monitoring
Peter J. Jones 11 months ago
parent
commit
ab5021ec99
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      modules/services/web/rails/default.nix

+ 3
- 3
modules/services/web/rails/default.nix View File

@@ -67,11 +67,11 @@ let
};

"/" = {
tryFiles = "$uri @app";
tryFiles = "$uri @rails-${app.name}";
};

"@app" = {
proxyPass = "http://localhost:${toString app.port}";
"@rails-${app.name}" = {
proxyPass = "http://127.0.0.1:${toString app.port}";
};
};
};

Loading…
Cancel
Save