I don't know how better to phrase that question so let me know if there is a better way but here is what I want to do.
I have an app that sends an html file based on the request url which also creates a cache of that html file in a cache folder so that nginx can just serve the cached file the next time someone visits that same url.
This is working as expected except that I don't want the cache to be read by nginx when there are query parameters. I want the app to be the one to handle the request when this happens but the cache gets sent instead. Here is what I have so far:
location / {
root /path/to/site;
try_files /content/cache/$uri.html @app;
}
location @app {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
So how do I have the try_files
bypass the content/cache/$uri.html
and go straight to the @app
when there are query args in the url?