About
History
New snippet →
Upload snippet →
Snippet #2388 (by symphorien, python)
#2388
Expires in: 0 minutes
View Raw
{
config
,
lib
,
pkgs
,
...
}:
let
xok
=
pkgs
.
stdenv
.
mkDerivation
{
name
=
"php-root"
;
buildCommand
=
''
mkdir
$
out
;
echo
' <?php phpinfo(); ?>'
>
$
out
/
index
.
php
;
''
;
};
cfg
=
config
.
services
.
nginx
;
in
{
services
.
nginx
=
{
enable
=
true
;
virtualHosts
.
"default"
=
{
root
=
"/data/webserver"
;
default
=
true
;
extraConfig
=
''
location
~
\
.
php
$
{
document_root
$
{
xok
};
include
$
{
cfg
.
package
}
/
conf
/
fastcgi_params
fastcgi_pass
127.0.0.1
:
9000
;
fastcgi_index
index
.
php
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
}
''
;
};
};
}
Wrap long lines
Reply to this snippet →
Honeypot, don't fill.
{ config, lib, pkgs, ... }: let xok = pkgs.stdenv.mkDerivation { name = "php-root"; buildCommand = '' mkdir $out; echo ' <?php phpinfo(); ?>' > $out/index.php; ''; }; cfg = config.services.nginx; in { services.nginx = { enable = true; virtualHosts."default" = { root = "/data/webserver"; default = true; extraConfig = '' location ~ \.php$ { document_root ${xok}; include ${cfg.package}/conf/fastcgi_params fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } ''; }; }; }
Text (preformatted)
Text (not code)
----------
ABAP
ApacheConf
AppleScript
ActionScript
Bash
BBCode
C
Clojure
COBOL
CSS
CUDA
Dart
Delphi
Diff
Django
Erlang
Fortran
Go
Groovy
Haml
Haskell
HTML
HTTP
INI
IRC
Java
JavaScript
JSON
Lua
Makefile
Mako
Mason
Matlab
Modula
Monkey
MySQL
NumPy
OCaml
Perl
PHP
PostScript
PowerShell
Prolog
Properties
Puppet
Python
Ruby
reStructuredText
Rust
Sass
Scala
Scheme
Scilab
SCSS
Smalltalk
Smarty
SQL
Tcl
Tcsh
TeX
Text (Preformatted)
Text (non-code)
VB.net
VimL
XML
XQuery
XSLT
YAML
Author:
⌘+⏎ or Ctrl+⏎
Expire in
One Time Snippet
In one hour
In one week
In one month