Skip to content

Instantly share code, notes, and snippets.

@joepie91

joepie91/.nix Secret

Last active July 28, 2019 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joepie91/eb8c448a44fcea1b880df81e42a9cc36 to your computer and use it in GitHub Desktop.
Save joepie91/eb8c448a44fcea1b880df81e42a9cc36 to your computer and use it in GitHub Desktop.
{
services.nginx = {
enable = true;
virtualHosts = {
"haless-new.cryto.net" = {
locations."/php-test" = {
alias = ./sources/test-php;
/* Derived from https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/ */
extraConfig = ''
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/phpfpm-main.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
'';
};
locations."/shadow" = {
alias = ./sources/shadow-generator;
};
locations."/knex-mirror" = {
alias = ./sources/knex-mirror;
};
};
};
};
services.mysql = {
enable = true;
package = pkgs.mysql55;
};
services.phpfpm = {
extraConfig = ''
log_level = debug
'';
pools = {
main = {
listen = "/var/run/phpfpm-main.sock";
extraConfig = ''
user = nobody
listen.owner = nginx
listen.group = nginx
listen.mode = 0660
pm = dynamic
pm.max_children = 75
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
'';
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment