egirls-nixos/ogdo.nix

57 lines
1.1 KiB
Nix
Raw Normal View History

2024-02-29 22:12:46 +00:00
{
users.groups.ogdo = { members = [ "nginx" "jaina" ]; };
services.nginx = {
enable = true;
# ꙮ.run
virtualHosts."xn--xx8a.run" = {
listen = [
{
addr = "0.0.0.0";
port = 80;
}
{
port = 80;
addr = "[::]";
}
# deliberately avoid listening with https
];
rejectSSL = true;
root = "/srv/ogdo";
extraConfig = ''
error_page 404 /;
2024-04-20 08:47:40 +00:00
access_log /var/log/nginx/ogdo.log combined;
2024-04-20 09:53:01 +00:00
add_header 'Cache-Control' 'no-cache';
2024-02-29 22:12:46 +00:00
'';
2024-02-29 22:14:01 +00:00
locations."/" = { index = "/index.html"; };
2024-04-20 09:00:17 +00:00
locations."~ ^/.+" = {
root = "/srv/ogdo/served-files";
tryFiles = "$uri =404";
2024-04-20 09:08:01 +00:00
extraConfig = ''
default_type application/pdf;
'';
2024-04-20 09:00:17 +00:00
};
2024-02-29 22:12:46 +00:00
};
2024-04-20 19:47:03 +00:00
virtualHosts."ogdo.run" = {
listen = [
{
addr = "0.0.0.0";
port = 80;
}
{
port = 80;
addr = "[::]";
}
];
rejectSSL = true;
2024-04-22 18:02:24 +00:00
locations."/".return = "301 http://xn--xx8a.run$request_uri";
2024-04-20 19:47:03 +00:00
};
2024-02-29 22:12:46 +00:00
};
}