Welcome! Log In Create A New Profile

Advanced

Re: Editing headers in both directions

Maxim Dounin
March 29, 2010 07:14AM
Hello!

On Mon, Mar 29, 2010 at 12:23:56PM +0200, Toni Mueller wrote:

> after digging deeper into my Domino problem, I found that I should be
> able to edit both incoming and outgoing headers, eg. to cut out the
> domain part of said cookie (reconfiguring the server is a no-go), and
> adding the part back in later when the client sends the modified cookie
> back, so the Domino server can properly recognize the cookie.
>
> I'd like to say something like
>
> rewrite_header <headername> <direction> ...
>
> where "..." is the same stuff as in the "rewrite" directive.
>
> I've started taking a close look at ngx_http_rewrite_module.c, but
> after reading some here
> http://www.evanmiller.org/nginx-modules-guide.html, I found that I'm
> most likely going down the wrong path. At least, I don't see how the
> functionality I want fits into Evan's taxonomy of "handler", "filter",
> and "upstream" modules.
>
> Some guidance would be MUCH appreciated!

You have to implement:

1. Rewriting of outgoing headers via header filter. This should
be more or less trivial, see various header filters for examples,
e.g. src/http/modules/ngx_http_headers_filter_module.c.

2. Rewriting of incoming headers. This may be done via variable
and something like

proxy_set_header Cookie $your_variable_with_rewritten_cookie;

in config (like it's done with X-Forwarded-For and
$proxy_add_x_forwarded_for variable).

Maxim Dounin

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

Editing headers in both directions

Toni Mueller March 29, 2010 06:34AM

Re: Editing headers in both directions

Maxim Dounin March 29, 2010 07:14AM

Re: Editing headers in both directions

Toni Mueller March 29, 2010 07:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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