-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit: add processing of static gzip assets
- routes are renamed to use "pass" for header check - formatted to compare with output from server
- Loading branch information
Showing
1 changed file
with
183 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,185 @@ | ||
{ | ||
"listeners": { | ||
"*:80": { | ||
"pass": "routes" | ||
} | ||
}, | ||
"routes": [ | ||
{ | ||
"match": { | ||
"uri": [ | ||
"!*/.well-known/*", | ||
"/vendor/*", | ||
"/core/profiles/demo_umami/modules/demo_umami_content/default_content/*", | ||
"*.engine", | ||
"*.inc", | ||
"*.install", | ||
"*.make", | ||
"*.module", | ||
"*.po", | ||
"*.profile", | ||
"*.sh", | ||
"*.theme", | ||
"*.tpl", | ||
"*.twig", | ||
"*.xtmpl", | ||
"*.yml", | ||
"*/.*", | ||
"*/Entries*", | ||
"*/Repository", | ||
"*/Root", | ||
"*/Tag", | ||
"*/Template", | ||
"*/composer.json", | ||
"*/composer.lock", | ||
"*/web.config", | ||
"*sql", | ||
"*.bak", | ||
"*.orig", | ||
"*.save", | ||
"*.swo", | ||
"*.swp", | ||
"*~" | ||
] | ||
}, | ||
"action": { | ||
"return": 404 | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"uri": [ | ||
"/core/authorize.php", | ||
"/core/install.php", | ||
"/core/modules/statistics/statistics.php", | ||
"~^/core/modules/system/tests/https?\\.php", | ||
"/core/rebuild.php", | ||
"/update.php", | ||
"/update.php/*" | ||
] | ||
}, | ||
"action": { | ||
"pass": "applications/drupal/direct" | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"uri": [ | ||
"!/index.php*", | ||
"*.php" | ||
] | ||
}, | ||
"action": { | ||
"return": 404 | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"share": "/var/www/html/web$uri", | ||
"fallback": { | ||
"pass": "applications/drupal/index" | ||
} | ||
} | ||
} | ||
], | ||
"applications": { | ||
"drupal": { | ||
"type": "php", | ||
"processes": { | ||
"max": 4, | ||
"spare": 2, | ||
"idle_timeout": 120 | ||
}, | ||
"limits": { | ||
"timeout": 300, | ||
"requests": 1500 | ||
}, | ||
"options": { | ||
"admin": { | ||
"memory_limit": "1G", | ||
"opcache.jit_buffer_size": "20M" | ||
} | ||
}, | ||
"targets": { | ||
"direct": { | ||
"root": "/var/www/html/web/" | ||
}, | ||
"index": { | ||
"root": "/var/www/html/web/", | ||
"script": "index.php" | ||
} | ||
} | ||
} | ||
}, | ||
"access_log": "/dev/stdout" | ||
"access_log": "/dev/stdout", | ||
"listeners": { | ||
"*:80": { | ||
"pass": "routes/main" | ||
} | ||
}, | ||
|
||
"routes": { | ||
"main": [ | ||
{ | ||
"match": { | ||
"uri": [ | ||
"!*/.well-known/*", | ||
"/vendor/*", | ||
"/core/profiles/demo_umami/modules/demo_umami_content/default_content/*", | ||
"*.engine", | ||
"*.inc", | ||
"*.install", | ||
"*.make", | ||
"*.module", | ||
"*.po", | ||
"*.profile", | ||
"*.sh", | ||
"*.theme", | ||
"*.tpl", | ||
"*.twig", | ||
"*.xtmpl", | ||
"*.yml", | ||
"*/.*", | ||
"*/Entries*", | ||
"*/Repository", | ||
"*/Root", | ||
"*/Tag", | ||
"*/Template", | ||
"*/composer.json", | ||
"*/composer.lock", | ||
"*/web.config", | ||
"*sql", | ||
"*.bak", | ||
"*.orig", | ||
"*.save", | ||
"*.swo", | ||
"*.swp", | ||
"*~" | ||
] | ||
}, | ||
|
||
"action": { | ||
"return": 404 | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"uri": [ | ||
"/core/authorize.php", | ||
"/core/install.php", | ||
"/core/modules/statistics/statistics.php", | ||
"~^/core/modules/system/tests/https?\\.php", | ||
"/core/rebuild.php", | ||
"/update.php", | ||
"/update.php/*" | ||
] | ||
}, | ||
|
||
"action": { | ||
"pass": "applications/drupal/direct" | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"uri": [ | ||
"!/index.php*", | ||
"*.php" | ||
] | ||
}, | ||
|
||
"action": { | ||
"return": 404 | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"uri": [ | ||
"~^.*css_[a-zA-Z0-9-_]+\\.css(?:\\?.*)?$", | ||
"~^.*js_[a-zA-Z0-9-_]+\\.js(?:\\?.*)?$" | ||
], | ||
|
||
"headers": [ | ||
{ | ||
"Accept-Encoding": "*gzip*" | ||
} | ||
] | ||
}, | ||
|
||
"action": { | ||
"pass": "routes/assets_gz" | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"share": "/var/www/html/web$uri", | ||
"fallback": { | ||
"pass": "applications/drupal/index" | ||
} | ||
} | ||
} | ||
], | ||
|
||
"assets_gz": [ | ||
{ | ||
"match": { | ||
"headers": [ | ||
{ | ||
"Accept-Encoding": "*gzip*" | ||
} | ||
] | ||
}, | ||
|
||
"action": { | ||
"share": "/var/www/html/web${uri}.gz", | ||
"response_headers": { | ||
"Content-Encoding": "gzip" | ||
}, | ||
|
||
"fallback": { | ||
"pass": "routes/assets" | ||
} | ||
} | ||
}, | ||
{ | ||
"action": { | ||
"pass": "routes/assets" | ||
} | ||
} | ||
], | ||
|
||
"assets": [ | ||
{ | ||
"action": { | ||
"share": "/var/www/html/web${uri}", | ||
"fallback": { | ||
"pass": "applications/drupal/index" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
|
||
"applications": { | ||
"drupal": { | ||
"type": "php", | ||
"stdout": "/dev/stdout", | ||
"stderr": "/dev/stderr", | ||
"processes": { | ||
"max": 4, | ||
"spare": 2, | ||
"idle_timeout": 120 | ||
}, | ||
|
||
"limits": { | ||
"timeout": 300, | ||
"requests": 1500 | ||
}, | ||
|
||
"options": { | ||
"admin": { | ||
"memory_limit": "1G", | ||
"opcache.jit_buffer_size": "20M" | ||
} | ||
}, | ||
|
||
"targets": { | ||
"direct": { | ||
"root": "/var/www/html/web/" | ||
}, | ||
|
||
"index": { | ||
"root": "/var/www/html/web/", | ||
"script": "index.php" | ||
} | ||
} | ||
} | ||
} | ||
} |