Opened 9 years ago

Closed 4 years ago

#967 closed enhancement (fixed)

Force secure bit on cookies when site running under SSL

Reported by: mmitar@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.9.x
Keywords: Cc: mmitar@…
uname -a:
nginx -V: nginx version: nginx/1.4.6 (Ubuntu)
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-auth-pam --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-echo --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/nginx-upstream-fair --add-module=/build/nginx-BU0ZJt/nginx-1.4.6/debian/modules/ngx_http_substitutions_filter_module

Description

It would be great if it would be possible to do something like proxy_cookie_secure on to force cookie secure flag to be set to on, no matter what the underlying app sends. So if a reverse proxy uses SSL it could force all cookies to be SSL-only.

Similarly proxy_cookie_httponly on could be useful as well, but that might break some apps.

Change History (3)

comment:1 by mmitar@…, 9 years ago

Wrong documentation, sorry. :-(

Version 0, edited 9 years ago by mmitar@… (next)

comment:2 by AirisX@…, 8 years ago

This third-party module could help you.

comment:3 by Maxim Dounin, 4 years ago

Resolution: fixed
Status: newclosed

The proxy_cookie_flags directive, introduced in nginx 1.19.3, makes it possible to add or remove various cookie flags, including secure and httponly.

Note: See TracTickets for help on using tickets.