Welcome! Log In Create A New Profile

Advanced

Re: Set-Cookie is missing via proxy

Isaac Hailperin
December 17, 2012 05:02AM
On 12/06/2012 05:02 PM, Maxim Dounin wrote:
>> location ~* \.(jpg|gif|png|css|js)
>> {
>> try_files $uri @proxy;
>> }
>>
>> location @proxy
>> {
>> proxy_pass http://backend-all-apaches;
>> }
>>
>> location /
>> {
>> proxy_pass http://backend-all-apaches;
>> }
>>
>> As far as my understanding goes, this will only cache
>> jpg|gif|png|css|js files, and send the rest directly to the backend.
>> Please correct me if I am wrong.
>
> You are wrong. It tries to lookup jpg/gif/png/css/js files
> directly on the file system as static files, but it's
>
> 1) Not cache. Cache is activated with proxy_cache directive, see
> http://nginx.org/r/proxy_cache.
>
> 2) Not related to html files you talked about.
>
> 3) Not related to the response in question as headers clearly
> indicate it was originally returned by Apache (note ETag in Apache
> format).
>
> Whether or not the response in question was cached can't be
> concluded from the information provided. Most likely it was as
> config says to cache all 200 responses (without cookies) for 60
> minutes.
Thank you Maxim, that was very helpfull! So indeed, my config was wrong,
so in debugging the original problem, I made wrong assumptions.

Now for the original problem:
The Set-Cookie was not missing, but it turned out that having
proxy_set_header Host $host;
twice as I did accidentally, "confused" the backend, which is why it did
not deliver the Set-Cookie header. Removing one instance solved that
problem. But that did not solve the session mixing. The session mixing
was due to
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
I set this earlier, because not every page set those headers correctly,
resulting in suboptimal cacheing. But it turns out that its really
needed for other pages, so I removed that line again. This solved the
session mixing problem.

Isaac

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Set-Cookie is missing via proxy

Isaac Hailperin December 05, 2012 06:02AM

Re: Set-Cookie is missing via proxy

Maxim Dounin December 05, 2012 07:24AM

Re: Set-Cookie is missing via proxy

Isaac Hailperin December 05, 2012 02:44PM

Re: Set-Cookie is missing via proxy

Isaac Hailperin December 05, 2012 03:14PM

Re: Set-Cookie is missing via proxy

Maxim Dounin December 06, 2012 08:38AM

Re: Set-Cookie is missing via proxy

Isaac Hailperin December 06, 2012 10:18AM

Re: Set-Cookie is missing via proxy

Maxim Dounin December 06, 2012 11:04AM

Re: Set-Cookie is missing via proxy

Isaac Hailperin December 17, 2012 05:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 200
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready