nginx_cookie_flag_module icon indicating copy to clipboard operation
nginx_cookie_flag_module copied to clipboard

Feature request: Ability to *remove* flags

Open victordidenko opened this issue 5 years ago • 6 comments

I have development nginx configuration, it is working on localhost with HTTP, but proxies requests to HTTPS upstream. And I need to remove Secure flag from upstream cookies.

I've found two questions from guys with same need, both without answers: https://serverfault.com/questions/853228/nginx-reverse-proxy-remove-secure-from-cookies https://stackoverflow.com/questions/41628020/nginx-remove-secure-flag-to-cookies-from-proxied-server

victordidenko avatar Apr 18 '19 14:04 victordidenko

Meanwhile I forked this module and changed it to nginx_unsecure_cookie_module

I'm frontend developer, my C/C++ knowledges are super low, so I wouldn't dare make a PR :) I just chopped your code and changed append part to strip "Secure" flag.

But this, of course, not a flexible solution.

yumauri avatar Apr 19 '19 08:04 yumauri

hi, do you know if there is an nginx docker image with nginx_unsecure_cookie_module

as we already have one with nginx_cookie_flag_module => https://hub.docker.com/r/rplan/nginx

boly38 avatar Sep 19 '19 15:09 boly38

@boly38 Hi! I made docker image with this module, but it is stored in internal repository. It could be dangerous, if someone will use this image without fully understanding, what one is doing. That is why I did't make public image.

But you can easily build your own image, just copy official nginx Dockerfile and add module while build nginx.

Here is example: https://gist.github.com/yumauri/2c93e727ee15f32529da351b030e1190 (I took not latest image, because they changed build process, and I didn't dig it yet)

yumauri avatar Sep 19 '19 16:09 yumauri

  • @yumauri thanks for your input, this save me a lots of time :) 👍
  • nginx itself is already a dangerous tool, so I think a disclaimer is suficent. ;)

boly38 avatar Sep 20 '19 09:09 boly38

@boly38 mentioned your image in readme :)

yumauri avatar Oct 14 '19 10:10 yumauri

not sure that makes me happy ;) now cyberdefence will know who is root responsible ! (just kidding, thanks 👍 )

boly38 avatar Oct 14 '19 11:10 boly38

Since version 1.19.3 nginx supports proxy_cookie_flags, so I've archived my repo.

yumauri avatar Apr 13 '23 19:04 yumauri