Skip to content

Instantly share code, notes, and snippets.

@nginx-gists
Last active November 11, 2022 00:03
Show Gist options
  • Select an option

  • Save nginx-gists/e5dcdc96e159e3d243fd8d16a9a34bfb to your computer and use it in GitHub Desktop.

Select an option

Save nginx-gists/e5dcdc96e159e3d243fd8d16a9a34bfb to your computer and use it in GitHub Desktop.
NGINX Unit 1.18.0 Adds Filesystem Isolation and Other Enhancements
{
"servers": {
"192.168.0.100:8080": {
"weight": 2,
},
"192.168.0.101:8080": {
"weight": 2,
},
"192.168.0.102:8080"
}
}
{
"servers": {
"192.168.0.100:8080",
"192.168.0.101:8080",
"192.168.0.102:8080"
}
}
{
"listeners": {
"*:80": {
"pass": "routes/slashes%2Fin%2Froute%2Fname"
}
},
"routes": {
"slashes/in/route/name": [
]
}
}
{
"routes": {
"slashes/in/route/name": [
{
"match": {
"uri": "/%2A",
"arguments": {
"%25": "%21%C3*"
}
},
"action": {
"return": 301,
"location": "http://fancyurls.example.com"
}
}
]
}
}
{
"servers": {
"192.168.0.100:8080",
"192.168.0.101:8080",
"192.168.0.102:8080": {
"weight": 0.5
}
}
}
{
"routes": [
{
"match": {
"uri": [
"*.php",
"*.php/*"
]
},
"action": {
"pass": "applications/phpapp/direct"
}
},
{
"action": {
"pass": "applications/phpapp/script_index"
}
},
],
"applications": {
"phpapp": {
"type": "php",
"user": "www-data",
"group": "www-data",
"targets": {
"direct": {
"root": "/var/www/app/"
},
"script_index": {
"root": "/var/www/app/",
"script": "index.php"
}
}
}
}
}
{
"routes": [
{
"match": {
"uri": [
"*.php",
"*.php/*"
]
},
"action": {
"pass": "applications/direct"
}
},
{
"action": {
"pass": "applications/script_index"
}
},
],
"applications": {
"direct": {
"type": "php",
"processes": {
"max": 5,
"spare": 0
},
"user": "www-data",
"group": "www-data",
"root": "/var/www/app/",
"index": "index.php"
},
"script_index": {
"type": "php",
"processes": {
"max": 20,
"spare": 5
},
"user": "www-data",
"group": "www-data",
"root": "/var/www/app/",
"script": "index.php"
}
}
}
{
"match": {
"uri": "/legacy/*"
},
"action": {
"return": 301,
"location": "http://legacy.example.com"
}
}
{
"type": "python 2.7",
"path": "/",
"home": "/venv/",
"module": "wsgi",
"isolation": {
"rootfs": "/var/app/sandbox/"
}
}
@nginx-gists
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment