Answer the question
In order to leave comments, you need to log in
How to clear cookies when proxying with nginx?
Solution in the comments to the tagged answer
We are using nginx as a frontend.
Our main domain is company.ru and the site on it works only on https.
On the pages of this domain, sometimes it is necessary to insert frames of partner sites.
Because Partners don't always support SSL, to get around protocol mismatch issues, we proxy partner sites through our nginx.
Thus, the partner site receives the address https://partner.company.ru
. Our authorization cookie is issued for the address .company.ru, i.e. partners can get its value on their server.
How to kill this cookie when proxying?
I know what can be done proxy_set_header Cookie "";
But this option will clear the cookies completely, which calls into question the performance.
You need to reset the cookie with a specific name.
Answer the question
In order to leave comments, you need to log in
Set your cookie to company.ru, not to .company.ru, and then the browser will not transfer the cookie to *.company.ru
. And it is most reliable to make a separate domain for these cases.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question