0

预期的生产环境将使用 AWS EKS nginx 入口控制器,因此最好不需要定制的 nginx 构建。

对于本地开发,已经安装了 docker 镜像https://hub.docker.com/r/lautre/nginx-cookie-flag ,它应该预先安装了 cookie-flag 模块。https://geekflare.com/httponly-secure-cookie-nginx/示例中建议的两种方法 都已尝试,但似乎不起作用:

http { 
 ...
 proxy_cookie_path / "/; HTTPOnly;   Secure";
 ...
}

server {
 ...
 proxy_cookie_path / "/; HTTPOnly;   Secure";
 ...
}

具体来说,令牌“atlassian.xsrf.token”从未签名为 HttpOnly,这是从 Web 应用程序https://confluence.atlassian.com/adminjiracloud/using-the-issue-collector-776636529 中的 jira 插件生成的。 html

问题:

  1. 找到的大多数示例都与上述相同,外部模块是唯一可用的解决方案吗?
  2. nginx plus 版本是否有这个模块,默认允许引用?
4

1 回答 1

0

您还可以使用 add_header 指令并手动设置 cookie 来解决此问题

例子

location / {
    add_header Set-Cookie 'MyCookie=SomeValue; Path=/; HttpOnly; Secure';
    proxy_pass http://1.2.3.4;
}
于 2020-04-07T19:28:30.037 回答