Set the flags
secure for cookies in
Set-Cookie upstream response headers.
Install the Cookie-Flag module.
For Amazon Linux, CentOS, Oracle Linux, and RHEL:
$ yum install nginx-plus-module-cookie-flag
For Debian and Ubuntu:
$ apt-get install nginx-plus-module-cookie-flag
$ zypper install nginx-plus-module-cookie-flag
Put the following directive in the top-level (“main”) context of the main NGINX Plus configuration file, /etc/nginx/nginx.conf:
Perform additional configuration as required by the module.
Reload NGINX Plus to enable the module:
$ nginx -t && nginx -s reload