Re: Homepage cache and cookies

2016-03-28 Thread john_smith77
Specifically I was writing that clients could get their cookies, but not served form the nginx cache. This has always been about whether or not the cached page was serving the cookies or not. With the exact same configuration for the cache, there is a difference between: location / and locatio

Re: Homepage cache and cookies

2016-03-26 Thread B.R.
Make sure you test this unexpected behavior with a minimal, reproducible configuration. If you succeed, please share it or (even better!) fill a bug report . Otherwise, that meant you probably did something Wrong. ​You were previously saying proxy_hise_headers did not pass

Re: Homepage cache and cookies

2016-03-25 Thread Ph. Gras
Hello John! I think you can do this better with sessions in NginX. I've made a script that checks if a client is a bot or not, by testing if the Google Analytics cookie is here, or not. If it is, the client can post a comment or login. If not, the server is giving a fake page. In my PHP script

Re: Homepage cache and cookies

2016-03-25 Thread john_smith77
So I found a solution and it seems like there is unexpected behavior from nginx. proxy_hide_header Set-Cookie does not seem to work when the location block is set to / So: location / { #Lots of other proxy stuff here.. proxy_hide_header "Set-Cookie"; } does not allow a cookie to

Re: Homepage cache and cookies

2016-03-25 Thread john_smith77
Indeed, but that prevents all cookies from being set. What I am looking for is to have a cache hit, but have the set-cookie served from the origin server. In Apache httpd cache, this can be accomplished with CacheIgnoreHeaders Set-Cookie. The back end server here is Apache and I have tried settin

Re: Homepage cache and cookies

2016-03-25 Thread B.R.
That seems to match what the docs for proxy_hide_header states, just do not use proxy_pass_header at the same time... which does the exact opposite. --- *B. R.* On Thu, Mar 24, 2016 at 9:31 PM, john_smith77 wrote: > Tha

Re: Homepage cache and cookies

2016-03-24 Thread john_smith77
Thanks for the info. I have removed the redundant config. I suppose what I am really getting at is that I would like Set-Cookie to never be cached with a cache MISS so that the cached cookie values are then not there for subsequent HITS. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,2

Re: Homepage cache and cookies

2016-03-24 Thread B.R.
The proxy_cache_key defines which key differentiate any cache object. By using $cookie_name in the string, the *value* of the cookie 'name' will be taken as part of the key. If multiple clients have the same combination of variables value (specifically, for cookie, presence, no presence or same val

Homepage cache and cookies

2016-03-24 Thread john_smith77
I am trying to cache the home page to a site. I am only caching the home page. If I put in a condition to check for cookies existing before caching, everything works as expected, but there is a high BYPASS rate due to the client not having the cookies the first time they visit the site. Once I took