I have an NGINX 1.11.10 and trying to manipulate the SameSite attribute of cookies. Looks like NGINX has an option
proxy_cookie_flags
However, this is only available in NGINX 1.19.3 and above.
How can I implement similar behaviour in 1.11.10 to manipulate all cookies, or specific cookies?
This is a similar configuration we have in Apache HTTPD.
# SameSite Cookie Configuration http://publib.boulder.ibm.com/httpserv/ihsdiag/_static/samesite-global.conf
# 1. Add SameSite=Strict and Secure if no SameSite found.
Header always edit Set-Cookie "^(?!.*(\s+|;)(?i)SameSite=)(.*)" "$0; SameSite=Strict; Secure" env=!SAMESITE_SKIP
Header onsuccess edit Set-Cookie "^(?!.*(\s+|;)(?i)SameSite=)(.*)" "$0; SameSite=Strict; Secure" env=!SAMESITE_SKIP
# 2. Remove duplicate SECURE flag (this keeps the above regex simpler)
Header always edit Set-Cookie "(.*(\s+|;)(?i)Secure(\s+|;).*) Secure$" "$1" env=!SAMESITE_SKIP
Header onsuccess edit Set-Cookie "(.*(\s+|;)(?i)Secure(\s+|;).*) Secure$" "$1" env=!SAMESITE_SKIP
# Why the duplication? always is not a superset of onsuccess the way it should be.