Nginx: Difference between revisions
imported>Makefu forceSSL implies enableSSL (which is now supposently onlySSL) ... |
imported>Csingley No edit summary |
||
| Line 12: | Line 12: | ||
}; | }; | ||
} | } | ||
</syntaxhighlight> | |||
LEMP stack (Nginx/MySQL/PHP) in <code>configuration.nix</code> | |||
<syntaxhighlight lang="nix"> | |||
services.nginx = { | |||
enable = true; | |||
virtualHosts."blog.example.com" = { | |||
enableACME = true; | |||
forceSSL = true; | |||
root = "/var/www/blog"; | |||
locations."~ \.php$".extraConfig = '' | |||
fastcgi_pass 127.0.0.1:9000; | |||
fastcgi_index index.php; | |||
''; | |||
}; | |||
}; | |||
services.mysql = { | |||
enable = true; | |||
package = pkgs.mariadb; | |||
}; | |||
services.phpfpm.poolConfigs.mypool = '' | |||
listen = 127.0.0.1:9000 | |||
user = nobody | |||
pm = dynamic | |||
pm.max_children = 5 | |||
pm.start_servers = 2 | |||
pm.min_spare_servers = 1 | |||
pm.max_spare_servers = 3 | |||
pm.max_requests = 500 | |||
''; | |||
</syntaxhighlight> | </syntaxhighlight> | ||