aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-08-09 16:15:27 +0800
committerZhongheng Liu <z.liu@outlook.com.gr>2024-08-09 16:15:27 +0800
commit3651ddb6cbdfcd965bb72756f67ca3fb2952a3c0 (patch)
treea45e0665ca18b319c3136f6d920874c031957fa2
parent362d2098bfec174de59255d8224e278822c40574 (diff)
downloadnixos-configuration-3651ddb6cbdfcd965bb72756f67ca3fb2952a3c0.tar.gz
nixos-configuration-3651ddb6cbdfcd965bb72756f67ca3fb2952a3c0.tar.bz2
nixos-configuration-3651ddb6cbdfcd965bb72756f67ca3fb2952a3c0.zip
feat: new nginx configuration
-rw-r--r--nixos/services/nginx.service.nix25
1 files changed, 20 insertions, 5 deletions
diff --git a/nixos/services/nginx.service.nix b/nixos/services/nginx.service.nix
index ae374c7..798f078 100644
--- a/nixos/services/nginx.service.nix
+++ b/nixos/services/nginx.service.nix
@@ -1,6 +1,21 @@
-{...}:
-{
- services.nginx = {
- enable = true;
- };
+{pkgs, ...}: {
+ services.nginx = {
+ enable = true;
+ virtualHosts."localhost" = {
+ root = "/srv/public";
+ locations = {
+ "/" = {
+ root = "/srv/public";
+ extraConfig = ''
+ autoindex on;
+ '';
+ };
+ };
+ listenAddresses = [
+ "127.0.0.1"
+ "[::1]"
+ ];
+ };
+ };
+ networking.firewall.allowedTCPPorts = [80];
}