31 lines
723 B
Nix
31 lines
723 B
Nix
{ phpsock, pkgs, ... }:
|
|
{
|
|
serverAliases = ["www.squi.bid"];
|
|
root = "/var/www/squi.bid"; # TODO: make declarative
|
|
|
|
locations = {
|
|
"/" = {
|
|
tryFiles = "$uri $uri.html $uri/ @extensionless-php";
|
|
index = "index.html index.htm index.php";
|
|
};
|
|
"~ \\.php$" = {
|
|
extraConfig = ''
|
|
fastcgi_pass unix:${phpsock};
|
|
include ${pkgs.nginx}/conf/fastcgi.conf;
|
|
expires 3m;
|
|
add_header Cache-Control "max-age=180, public";
|
|
'';
|
|
};
|
|
"~* \\.(?:css|js|jpg|png)$" = {
|
|
extraConfig = ''
|
|
expires 1y;
|
|
access_log off;
|
|
add_header Cache-Control "max-age=31556952, public";
|
|
'';
|
|
};
|
|
};
|
|
|
|
# https
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
}
|