Skip to content

Commit

Permalink
Bind mount my Website-Instances dir which Nginx can access
Browse files Browse the repository at this point in the history
Signed-off-by: John Titor <[email protected]>
  • Loading branch information
JohnRTitor committed Oct 1, 2024
1 parent b57a91a commit 969b7b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dev-environment/nginx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
config,
lib,
pkgs,
userSettings,
...
}: {
services.nginx.enable = true;

# Nginx virtual host configuration for localhost
services.nginx.virtualHosts."localhost" = {
root = "/var/www/phptest";
root = "/var/www/localhost-server";
extraConfig = ''
index index.php;
'';
Expand Down Expand Up @@ -50,4 +51,13 @@
};
phpEnv."PATH" = lib.makeBinPath [ pkgs.php ];
};

# Bind mount the website instances directory
# As nginx can't follow symlinks
# And will have permissions issues if we use symlinks
fileSystems."/var/www/localhost-server" = {
device = "/home/masum/Website-Instances";
fsType = "none";
options = ["bind"];
};
}

0 comments on commit 969b7b7

Please sign in to comment.