I am trying to improve the page speed of a site I run by serving static content directly from NGINX rather than the request hitting PHP.
I have webpages at paths like this:
- gamea.com.mysite.com
- anotherb.net.mysite.com
- finalc.org.mysite.com
When a page is generated for these, it's stored in a path like this:
- /storage/app/page-cache/games/game/gamea_com/1.c
- /storage/app/page-cache/games/anot/anotherb_net/1.c
- /storage/app/page-cache/games/fina/finalc_org/1.c
The path structure takes the first 4 letters of the subdomain, and then follows by another folder with the full path and replaces "." with "_" - e.g. "gamea.com" = "/game/gamea_com/". The actual cache page file is stored as "1.c"
How might this be accomplished through NGINX? I'm a bit stuck, I did find this article but I'm unsure how to use it in my case - can anyone provide an example NGINX config that points NGINX to the correct path as described above?
I thank you whoever can help me with this!