Welcome! Log In Create A New Profile

Advanced

Re: 500 Error when using proxy_cookie_domain

Valentin V. Bartenev
May 18, 2012 04:24PM
On Friday 18 May 2012 21:25:41 omar_h wrote:
> Hello, I'm using Nginx as a reverse proxy and I'm seeing 500 errors
> anytime the proxy_cookie_domain option feature is used. I'm trying to
> change the domain in the "Set-Cookie" header.
>
> The response header shows the replaced domain properly in the
> "Set-Cookie" header, however, it is a 500 Error response and does not
> output the page content.
>
> Is there any way to find the cause of this error? I tried using both
> strace and the debug log, but could not find any cause.
>
> Here is a snippet of the debug log
>

The patch below should resolve this issue. Could you please test it?

Index: src/http/ngx_http_upstream.c
===================================================================
--- src/http/ngx_http_upstream.c (revision 4642)
+++ src/http/ngx_http_upstream.c (working copy)
@@ -3677,6 +3677,7 @@ static ngx_int_t
ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
ngx_uint_t offset)
{
+ ngx_int_t rc;
ngx_table_elt_t *ho;

ho = ngx_list_push(&r->headers_out.headers);
@@ -3687,7 +3688,8 @@ ngx_http_upstream_rewrite_set_cookie(ngx_http_requ
*ho = *h;

if (r->upstream->rewrite_cookie) {
- return r->upstream->rewrite_cookie(r, ho);
+ rc = r->upstream->rewrite_cookie(r, ho);
+ return (rc == NGX_DECLINED) ? NGX_OK : rc;
}

return NGX_OK;

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

500 Error when using proxy_cookie_domain

omar_h May 18, 2012 01:25PM

Re: 500 Error when using proxy_cookie_domain

omar_h May 18, 2012 01:29PM

Re: 500 Error when using proxy_cookie_domain

Valentin V. Bartenev May 18, 2012 03:40PM

Re: 500 Error when using proxy_cookie_domain

Valentin V. Bartenev May 18, 2012 04:02PM

Re: 500 Error when using proxy_cookie_domain

omar_h May 18, 2012 04:37PM

Re: 500 Error when using proxy_cookie_domain

Valentin V. Bartenev May 18, 2012 04:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
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