how to redirect 302 in code?

Kirill A. Korinskiy catap+nginx at catap.ru
Tue Aug 25 17:37:47 MSD 2009


At Tue, 25 Aug 2009 09:04:09 -0400,
"wangbin579" <nginx-forum at nginx.us> wrote:

Ok. Follow code work:

	header = ngx_list_push(&r->headers_out.headers);
	if (header == NULL) {
	    return NGX_HTTP_INTERNAL_SERVER_ERROR;
	}

	header->hash = 1;
	header->key.len = sizeof("Location") - 1;
	header->key.data = (u_char *) "Location";
	header->value.len = sizeof("http://google.com/") - 1;
	header->value.data = (u_char *) "http://google.com/" - 1;

	return NGX_HTTP_MOVED_TEMPORARILY;
	
-- 
wbr, Kirill





More information about the nginx mailing list