Welcome! Log In Create A New Profile

Advanced

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin
September 28, 2011 12:14PM
Hello!

On Wed, Sep 28, 2011 at 12:05:07PM -0400, csg wrote:

> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Errors suggest you don't have $backend set, and
> > resulting
> > proxy_pass tries to go to "http://" which is
> > invalid.
>
> Yup, I am just curious how to accomplish that if you want to perform
> some rewriting before, for example to strip off some leading parts of
> the URL path. I came up with following test case:

[...]

> location / {
> rewrite ^/foo/(.*)$ /$1 break;

The "break" here will stop execution of rewrite module directives
(including "set" below) on match.

>
> resolver 127.0.0.1;
>
> set $backend "localhost:90";

This "set" won't be executed due to break above...

> proxy_pass http://$backend;

.... and $backend won't be set as a result. Moving "set" before
"rewrite .. break" will do the trick.

Maxim Dounin

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

Does Nginx honor DNS TTLs for proxy upstreams?

csg September 26, 2011 04:42AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 26, 2011 05:38AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 26, 2011 09:40AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 26, 2011 09:58AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 28, 2011 12:05PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 28, 2011 12:14PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 28, 2011 03:35PM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:31AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:32AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg September 29, 2011 03:53AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

Maxim Dounin September 29, 2011 03:30AM

Re: Does Nginx honor DNS TTLs for proxy upstreams?

csg October 04, 2011 04:12AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 92
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready