Comments (8)
@thet Do you have any particular implementation idea in mind? I'm also looking for something to make cookie specification more generic. Thoughts are appreciated and I'll add to this project if it makes sense to the maintainers.
from eea.docker.varnish.
@avoinea The pattern described by @thet above is similar to what we do. Can you comment on this proposal to provide some cookie configuration in the eea image:
A new piece of python, config_cookies.py that is called toward the beginning of docker-entrypoint.sh to extract cookie configuration details from new environment variables similar to how it's done in add_backends.py. It would write the output to conf.d for ultimately inclusion in the final .vcl via the normal iteration.
It would consist of three main areas: cookies for pass, cookie removal, and maybe config for pipe of large files. This is consistent to both our needs an those mentioned by thet. Feedback is appreciated.
from eea.docker.varnish.
@twajr A pull-request would be appreciated as I don't really get it where should this be inserted.
Thank you!
from eea.docker.varnish.
@avoinea Okay, I'll do a bit of work first as it sounds like you're open to the possibility. If it doesn't work out, I'll put in our image. This change, though, may allow us to use your image directly. Give me a day or two. Thanks!
from eea.docker.varnish.
@twajr I'd experiment to remove any cookies for static files. I can't currently think of any use case where file types which are most likely static files would need cookies.
So the first rule would change to (untested):
/* delete cookies for static resources */
set req.http.UrlNoQs = regsub(req.url, "\?.*$", "");
if (req.http.UrlNoQs ~ "\.(js|css|kss|gif|png|jpg|mp3|mp4|pdf)$") {
unset req.http.cookie;
return(pipe);
}
from eea.docker.varnish.
@thet Thanks, yeah, that one looks straight forward. I'm going to focus first on adding setup for 'cookie config' similar to backends. Once that is in place, along with the first item (which is our requirement for a cookies white list), we can iterate on various cookie options that we expect to configure, like your example.
from eea.docker.varnish.
@avoinea I have an initial PR ready, but it's not clear to me how Varnish handles the same vcl_recv sub defined multiple times. It allows me to do it and it compiles, and the default vcl_recv is always placed in the final config as well. So, ultimately with my change there are three defined vcl_recv routines versus two in the current implementation. I'll continue investigating and testing unless you have some words of wisdom around that issue. (Eh, never mind, I can see in the generated C code that all three are called and it must be based on parse order or something). I'll put in a basic PR and we can discuss.
from eea.docker.varnish.
@twajr Thank you!
eeacms/varnish:4.1-5.0
released!
from eea.docker.varnish.
Related Issues (13)
- Chaperone error on startup HOT 1
- /etc/varnish/default.vcl grows every time container is reloaded HOT 4
- PRIVILEDGED_USER does not seem to work HOT 2
- static act purge IP adresses prevent successful purge HOT 4
- Don't force malloc storage backend HOT 6
- Update documentation to reflect how to enable easy access to control terminal
- Backend name too long HOT 3
- I cant use another backends except eeacms/hello
- Permission error HOT 1
- Statistics / vagent2 HOT 3
- How do I access the admin console? HOT 1
- Admin not running? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eea.docker.varnish.