-
MODX Staff
- 10,725 Posts
Chris:
Can you explain how you are routing requests to your various Contexts? Are these all coming in via one virtual host?
In the location rule,
/core/cache/statcache/web/$uri~index.html
web is the default context. This is the bit I'd obviously need to change on each iteration of the rule.
-
MODX Staff
- 10,725 Posts
I'm not sure this is possible without some kind of map available to the nginx config relating each context to the domains that are to be routed to it. Let me try to look into it when I get a chance and see if there might be a sane way to handle the mapping...
Thanks Jason, really appreciate it. It's unlikely that all the contexts will need to be routed through statcache, so could multiple server {} sections be set up, one for each context, with a generic, non-cached version following? Can you even have multiple servers with the same root folder?
Can you guess I haven't worked with NGINX before?!
I think I'm going to go with a bit of a hybrid solution, using the context's http_host setting to determine the folder name for its cache and a few different server rules for each type of domain being hosted. It would be much easier if they all followed the same format, but nothing's ever that easy!
Thanks again for your help Jason - feeling the MODX love today!
-
MODX Staff
- 10,725 Posts
No problem Chris. Let me know if you have some suggestions or changes for statcache to help handle these scenarios.