Welcome! Log In Create A New Profile

Advanced

Re: proxy_redirect can't be def'd in an include file; ok in main config?

Maxim Dounin
January 21, 2014 02:12PM
Hello!

On Tue, Jan 21, 2014 at 10:55:58AM -0800, rand@sent.com wrote:

> i've nginx 1.5.8
>
> If I check a config containing
>
> cat sites/test.conf
> ...
> location / {
> proxy_pass http://VARNISH;
> include includes/varnish.conf;
> }
> ...
> cat includes/varnish.conf
> proxy_redirect default;
> proxy_connect_timeout 600s;
> proxy_read_timeout 600s;
> ...
>
> I get an error
>
> nginx: [emerg] "proxy_redirect default" should be placed after
> the "proxy_pass" directive in
> //etc/nginx/includes/varnish.conf:1
> nginx: configuration file //etc/nginx/nginx.conf test failed
>
> but if I change to,
>
> cat sites/test.conf
> ...
> location / {
> proxy_pass http://VARNISH;
> + proxy_redirect default;
> include includes/varnish.conf;
> }
> ...
> cat includes/varnish.conf
> - proxy_redirect default;
> + #proxy_redirect default;
> proxy_connect_timeout 600s;
> proxy_read_timeout 600s;
> ...
>
> then config check returns
>
> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
> nginx: configuration file /etc/nginx/nginx.conf test is
> successful
>
> Why isn't the proxy_redirect viable in the include file? Intended, or a
> bug?

Most likely, there are other uses of the "includes/varnish.conf"
include file in your config, and they cause error reported.

And it's certainly a wrong list to write such questions. Thank
you for cooperation.

--
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

proxy_redirect can't be def'd in an include file; ok in main config?

Anonymous User 719 January 21, 2014 01:58PM

Re: proxy_redirect can't be def'd in an include file; ok in main config?

Maxim Dounin 430 January 21, 2014 02:12PM



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

Online Users

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