Manually applied 415b927 from nixpkgs to nginx config. Changed mail vhost back to previous setting (as it otherwise fails when the mailserver service is not enabled).

This commit is contained in:
Kevin Baensch 2019-04-11 22:58:05 +02:00
parent 0b3b1ba4af
commit 61e2f5b6ce

View file

@ -62,7 +62,7 @@ mkIf (elem "nginx" config.machine.services) {
}
'';
};
"${config.mailserver.fqdn}" = mkIf config.mailserver.enable {
"mail.${config.machine.domain}" = mkIf config.mailserver.enable {
serverName = config.mailserver.fqdn;
enableACME = true;
forceSSL = true;
@ -97,19 +97,19 @@ mkIf (elem "nginx" config.machine.services) {
priority = 210;
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
};
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/" = {
"~ ^\\/(?:build|tests|config|lib|3rdparty|templates|data)\\/" = {
priority = 300;
extraConfig = "deny all;";
};
"~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)" = {
"~ ^\\/(?:\\.|autotest|occ|issue|indie|db_|console)" = {
priority = 300;
extraConfig = "deny all;";
};
"~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\\.php(?:$|/)" = {
"~ ^\\/(?:index|remote|public|cron|core/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|ocs-provider\\/.+|ocm-provider\\/.+)\\.php(?:$|\\/)" = {
priority = 500;
extraConfig = ''
include ${config.services.nginx.package}/conf/fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_split_path_info ^(.+\.php)(\\/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS ${if config.services.nextcloud.https then "on" else "off"};
fastcgi_param modHeadersAvailable true;
@ -120,7 +120,7 @@ mkIf (elem "nginx" config.machine.services) {
fastcgi_read_timeout 120s;
'';
};
"~ ^/(?:updater|ocs-provider|ocm-provider)(?:$|\/)".extraConfig = ''
"~ ^/(?:updater|ocs-provider|ocm-provider)(?:$|\\/)".extraConfig = ''
try_files $uri/ =404;
index index.php;
'';