I needed to have cache on “/” based on the user’s IP, but based on the full URL when parameters were passed.
This webpage provides MaxMind information: when you request “/” you will see your own, but you could use “/?ip=xxx.xxxx.xxx.xxx” to get information of any IP. So I needed an NGINX cache that was unique per IP on “/” but shared for “/?ip=xxx.xxxx.xxx.xxx”.
To achieve this, you need to change the default “proxy_cache_key” configuration. This was my approach:
This can be improved, but gave me the cornerstone for my caching needs.