# Cookie based proxy redirect

**URL:** <https://www.ruby-forum.com/t/cookie-based-proxy-redirect/228756>\
**Category:** NGINX\
**Created:** [May 6, 2013, 10:29pm UTC](https://www.ruby-forum.com/t/cookie-based-proxy-redirect/228756 "2013-05-06T22:29:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![juice-qr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8dc957/32.png) [@juice-qr](https://www.ruby-forum.com/u/juice-qr)\
**Post date:** [May 6, 2013, 10:29pm UTC](https://www.ruby-forum.com/t/cookie-based-proxy-redirect/228756/1 "2013-05-06T22:29:59Z")

</div>

Hi, I’m using nginx in a reverse proxy setup with 2 apache 2.4 backends,  
I’ve configured a cookie based proxy\_pass setup as shown in  
[http://dgtool.blogspot.com/2013/02/nginx-as-sticky-balancer-for-ha-using.html](http://dgtool.blogspot.com/2013/02/nginx-as-sticky-balancer-for-ha-using.html)  
, however php header redirects seem to die (or the browser doesn’t  
like)  
when nginx goes to redirect them internally with the ‘502 bad gateway’  
which  
should forward it to the upstream pool.

All other urls work fine, but when a request comes in with a header  
based  
redirect, something is getting stuck on the 502 bad gateway, the browser  
just stops with a blank page. Not sure if I can add something to nginx  
to  
fix…

Thanks

Posted at Nginx Forum:

> **[cookie based proxy redirect](https://forum.nginx.org/read.php?2,238923,238923#msg-238923)**
>
> Hi, I'm using nginx in a reverse proxy setup with 2 apache 2.4 backends, I've configured a cookie based proxy\_pass setup as shown in http://dgtool.blogspot.com/2013/02/nginx-as-sticky-balancer-for-ha-using.html , however php header redirects seem to...

---

<div class="post-metadata">

**Author:** ![juice-qr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8dc957/32.png) [@juice-qr](https://www.ruby-forum.com/u/juice-qr)\
**Post date:** [May 7, 2013, 3:16am UTC](https://www.ruby-forum.com/t/cookie-based-proxy-redirect/228756/2 "2013-05-07T03:16:12Z")

</div>

Configs :

[http://pastebin.com/QDpjDSBY](http://pastebin.com/QDpjDSBY)  
[http://pastebin.com/SyQTmq8v](http://pastebin.com/SyQTmq8v)

Posted at Nginx Forum:

> **[Re: cookie based proxy redirect](https://forum.nginx.org/read.php?2,238923,238926#msg-238926)**
>
> Hi, I'm using nginx in a reverse proxy setup with 2 apache 2.4 backends, I've configured a cookie based proxy\_pass setup as shown in http://dgtool.blogspot.com/2013/02/nginx-as-sticky-balancer-for-ha-using.html , however php header redirects seem to...
