nixos/roundcube: update nginx configuration

This commit is contained in:
Izorkin 2023-12-24 18:50:05 +03:00
parent ee024ac138
commit 3b74d8781f
No known key found for this signature in database
GPG Key ID: 1436C1B3F3679F09

View File

@ -148,20 +148,33 @@ in
${cfg.hostName} = {
forceSSL = mkDefault true;
enableACME = mkDefault true;
root = cfg.package;
locations."/" = {
root = cfg.package;
index = "index.php";
priority = 1100;
extraConfig = ''
location ~* \.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:${fpm.socket};
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include ${config.services.nginx.package}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
}
add_header Cache-Control 'public, max-age=604800, must-revalidate';
'';
};
locations."~ ^/(SQL|bin|config|logs|temp|vendor)/" = {
priority = 3110;
extraConfig = ''
return 404;
'';
};
locations."~ ^/(CHANGELOG.md|INSTALL|LICENSE|README.md|SECURITY.md|UPGRADING|composer.json|composer.lock)" = {
priority = 3120;
extraConfig = ''
return 404;
'';
};
locations."~* \\.php(/|$)" = {
priority = 3130;
extraConfig = ''
fastcgi_pass unix:${fpm.socket};
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include ${config.services.nginx.package}/conf/fastcgi.conf;
'';
};
};