Refactor shared Nix configuration to use domain parameter
Updated the shared Nix configuration to replace the hostname parameter with a domain parameter, allowing for more flexible virtual host configurations. Adjusted machine1 and machine2 configurations to reflect this change, ensuring proper domain usage for Nginx virtual hosts, including new entries for web-app, LNbits, and image services.
This commit is contained in:
parent
ea697275ba
commit
e399130072
1 changed files with 21 additions and 3 deletions
|
|
@ -1,8 +1,8 @@
|
|||
{ config, pkgs, hostName, ... }:
|
||||
{ config, pkgs, domain, ... }:
|
||||
|
||||
{
|
||||
# Set hostname (passed as parameter)
|
||||
networking.hostName = hostName;
|
||||
networking.hostName = domain;
|
||||
|
||||
# System packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
@ -17,10 +17,28 @@
|
|||
# Enable and configure nginx
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
virtualHosts."${hostName}" = {
|
||||
|
||||
# Web-app service
|
||||
virtualHosts."app.${domain}" = {
|
||||
root = "/var/src/web-app-dist";
|
||||
locations."/" = {
|
||||
index = "index.html";
|
||||
tryFiles = "$uri $uri/ /index.html";
|
||||
};
|
||||
};
|
||||
|
||||
# LNbits service (example - adjust as needed)
|
||||
virtualHosts."lnbits.${domain}" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:5000";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Image service (example - adjust as needed)
|
||||
virtualHosts."img.${domain}" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8080";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue