Welcome! Log In Create A New Profile

Advanced

Re: How to save into variable proxy header response?

Maxim Dounin
April 21, 2014 06:56AM
Hello!

On Sun, Apr 20, 2014 at 05:29:10AM -0400, google000 wrote:

> I have tryeid to do something like this but it seems that variable
> $upstream_http_content_disposition is empty.. when I want to redirect to
> different url..
>
> proxy_pass http://www.domainresultget.com;
> set $x $upstream_http_content_disposition;
> return 301 http://domaintest.com/test.php?x=$x;
>
> variable $x is empty..

This is not going work, as "return 301" will happen before the
proxy_pass. See here for basic explanation on how rewrite module
works:

http://nginx.org/en/docs/http/ngx_http_rewrite_module.html.

It looks like you want nginx to do a request to upstream server,
and then return a completely different response to a client. In
case of 200 responses, this is something that can be done, e.g.,
by using auth request module, see here:

http://nginx.org/en/docs/http/ngx_http_auth_request_module.html

It might also be a good idea to change your backends to actually
return responses you want to be returned to clients instead of
trying to change them with nginx configs.

--
Maxim Dounin
http://nginx.org/

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

How to save into variable proxy header response?

google000 April 19, 2014 01:49PM

Re: How to save into variable proxy header response?

Maxim Dounin April 19, 2014 03:38PM

Re: How to save into variable proxy header response?

google000 April 20, 2014 05:29AM

Re: How to save into variable proxy header response?

google000 April 20, 2014 11:38AM

Re: How to save into variable proxy header response?

Maxim Dounin April 21, 2014 06:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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