nginx_cookie_flag_module
nginx_cookie_flag_module copied to clipboard
Feature request: Ability to *remove* flags
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
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.
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 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 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 mentioned your image in readme :)
not sure that makes me happy ;) now cyberdefence will know who is root responsible ! (just kidding, thanks 👍 )
Since version 1.19.3 nginx supports proxy_cookie_flags, so I've archived my repo.