This commit is contained in:
2024-11-05 12:48:30 +01:00
parent d8db7df64e
commit c9a024840b
20 changed files with 301 additions and 70 deletions

View File

@@ -1,7 +1,12 @@
{ pkgs, lib, config, ... }:
let
domain = "cloonar.com";
domain = config.networking.domain;
dataDir = "/var/www/${domain}";
mkWellKnown = data: ''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON data}';
'';
in {
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
@@ -44,6 +49,10 @@ in {
locations."~ [^/]\.php(/|$)".extraConfig = ''
deny all;
'';
# matrix
locations."= /.well-known/matrix/server".extraConfig = mkWellKnown { "m.server" = "matrix.cloonar.com:443"; };
locations."= /.well-known/matrix/client".extraConfig = mkWellKnown { "m.homeserver".base_url = "https://matrix.cloonar.com"; };
};
users.users."${domain}" = {
isNormalUser = true;

View File

@@ -37,18 +37,30 @@ in {
error_page 404 /index.php;
'';
locations."/favicon.ico".extraConfig = ''
log_not_found off;
access_log off;
'';
locations."/robots.txt".extraConfig = ''
access_log off;
log_not_found off;
'';
locations."/".extraConfig = ''
try_files $uri $uri/ /index.php$is_args$args;
'';
locations = {
"/favicon.ico".extraConfig = ''
log_not_found off;
access_log off;
'';
"/robots.txt".extraConfig = ''
access_log off;
log_not_found off;
'';
"~ ^/[^/]+/".extraConfig = ''
try_files $uri $uri/index.php /index.php;
'';
# "/".extraConfig = ''
# try_files $uri $uri/index.php;
# '';
#
# "~ /$".extraConfig = ''
# try_files $uri $uri/index.php /index.php;
# '';
};
phpPackage = pkgs.php82;
};
}