Opened 10 years ago

Closed 9 years ago

#635 closed defect (fixed)

include directive not allowed within upstream context

Reported by: Corey Farrell Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.7.x
Keywords: Cc:
uname -a: Linux testserver1 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.7.3

Description

http://nginx.org/en/docs/ngx_core_module.html#include states that the include directive is allowed in any context, however the following fails:

upstream rpc_proxy {

server unix:/var/run/rpc.http.sock;
include rpc_proxy.backends;

}

[emerg] "include" directive is not allowed here in /etc/nginx/rpc_proxy.conf:3

Having this working would be very useful for separation of configuration between packaged (static) config and user defined. In my case the primary backend is a unix socket, alternate backends may be configured by the user if the local service is failed.

The intent was for unix:/var/run/rpc.http.sock to be defined in a file that can be replaced by RPM on update, where rpc_proxy.backends would not be replaced by any updates and may contain additional remote servers defined by the system administrator.

Attachments (1)

upstream-include.patch (393 bytes ) - added by Corey Farrell 10 years ago.

Download all attachments as: .zip

Change History (3)

by Corey Farrell, 10 years ago

Attachment: upstream-include.patch added

comment:1 by Ruslan Ermilov <ru@…>, 9 years ago

In 6305:18428f775b2c/nginx:

Core: enabled "include" inside http upstreams (ticket #635).

The directive already works inside stream upstream blocks.

comment:2 by Ruslan Ermilov, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.