Hello,
I'm having a hard time caching requests such as the following due to the "Set-Cookie" entries returned by the upstream application:
~$ curl -I https://[redacted]/[redacted]/amp
HTTP/1.1 200 OK
Date: Mon, 23 Sep 2019 07:28:09 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
X-Pingback: https://[redacted]/xmlrpc.php
Set-Cookie: pvc_visits[0]=1569310089b5472; expires=Tue, 24-Sep-2019 07:28:09 GMT; Max-Age=86400; path=/; secure; HttpOnly
Set-Cookie: cookielawinfo-checkbox-necessary=yes; expires=Mon, 23-Sep-2019 08:28:09 GMT; Max-Age=3600; path=/
Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: max-age=3600
Expires: Mon, 23 Sep 2019 08:28:09 GMT
Vary: Accept-Encoding
Referrer-Policy: no-referrer-when-downgrade
Alternate-Protocol: 443:npn-http/2
X-Request-ID: iptrysbtcqgffnvy
X-Cache-Status: MISS-0
Would it be possible to strip cookies using a regex from the backend response using Lua, before the request reaches proxy_cache, in order to force it to cache? Unfortunately, I have no control over the backend application, and I would like to only selectively remove cookies versus all cookies to avoid content issues. Any help would be greatly appreciated