Welcome! Log In Create A New Profile

Advanced

Re: Handling Large Number of Dynamic Hosts in Custom Module Subrequests

Maxim Dounin
September 27, 2016 08:42AM
Hello!

On Mon, Sep 26, 2016 at 06:09:07PM +0000, Cloud Gate wrote:

[...]

> The first alternative approach we've come up with is to set an
> HTTP header in the subrequest containing the target URL
> (x_our_proxy_url=http://host1.domain.foo/...), target the
> subrequest at a static /ourproxy location, and in nginx.conf
> pass the URL from the header to proxy_pass:
>
> location /ourproxy {
> proxy_pass $http_x_our_proxy_url;
> }
>
> While this works, it seems somewhat ad-hoc, and we're wondering
> if there are better options for a subrequest to target arbitrary
> hosts.
> module.

In general, using proxy_pass with a variable is correct. Though
instead of abusing HTTP headers (in general, this is not something
nginx allows, and you are likely doing it wrong) I would recommend
using part of URI instead, or just providing appropriate variable
from your module.

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

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

Handling Large Number of Dynamic Hosts in Custom Module Subrequests

Cloud Gate 507 September 26, 2016 02:10PM

Re: Handling Large Number of Dynamic Hosts in Custom Module Subrequests

Maxim Dounin 239 September 27, 2016 08:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

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