Snippet #2387 (by symphorien, python)

  • #2387
Expires in: 0 minutes View Raw
  1. { config, lib, pkgs, ... }:
  2. let
  3.  xok = pkgs.writeText "/data/webserver/info.php"
  4.  ''
  5.    <?php
  6.      phpinfo();
  7.    ?>
  8.  '';
  9.  cfg = config.services.nginx;
  10. in
  11. {
  12.    services.nginx = {
  13.        enable = true;
  14.        virtualHosts."default" = {
  15.            root = "/data/webserver";
  16.            default = true;
  17.            extraConfig = ''
  18.              location ~ \.php$ {
  19.                include ${cfg.package}/conf/fastcgi_params
  20.                fastcgi_pass  127.0.0.1:9000;
  21.                fastcgi_index index.php;
  22.                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  23.              }
  24.            '';
  25.        };
  26.    };
  27.  
  28. }

Reply to this snippet →

Honeypot, don't fill.
⌘+⏎ or Ctrl+⏎