How to set all cookies as secure

1. Caddy version (caddy version):

v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=

2. How I run Caddy:

I run caddy as ssl termination for some http backends. Simple reverse proxy

a. System environment:

b. Command:

./caddy start

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:, {
        #header +Set-Cookie "JSESSIONID={~JSESSIONID}; secure"

        reverse_proxy localhost:8082 {

3. The problem I’m having:

In haproxy I can reg replace headers in the frontend to set every cookie secure for example

So if the header starts with ‘set-cookie:’ append ‘; Secure’ to it

rspirep ^(set-cookie:.*) \1;\ Secure

4. Error messages and/or full log output:

5. What I already tried:

Playing around with header in http block, with header_down in reverse_proxy but still I cant get my head around this…
header +Set-Cookie “JSESSIONID={~JSESSIONID}; secure”

6. Links to relevant resources:

This topic was automatically closed after 30 days. New replies are no longer allowed.