changes
This commit is contained in:
@@ -74,6 +74,7 @@
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
zramSwap.enable = true;
|
||||
networking.hostName = "web-arm";
|
||||
networking.domain = "cloonar.com";
|
||||
services.openssh.enable = true;
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN/2SAFm50kraB1fepAizox/QRXxB7WbqVbH+5OPalDT47VIJGNKOKhixQoqhABHxEoLxdf/C83wxlCVlPV9poLfDgVkA3Lyt5r3tSFQ6QjjOJAgchWamMsxxyGBedhKvhiEzcr/Lxytnoz3kjDG8fqQJwEpdqMmJoMUfyL2Rqp16u+FQ7d5aJtwO8EUqovhMaNO7rggjPpV/uMOg+tBxxmscliN7DLuP4EMTA/FwXVzcFNbOx3K9BdpMRAaSJt4SWcJO2cS2KHA5n/H+PQI7nz5KN3Yr/upJN5fROhi/SHvK39QOx12Pv7FCuWlc+oR68vLaoCKYhnkl3DnCfc7A7"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user