I'm trying to package 2 applications that use nginx as a proxy and deliver each a config file into /etc/nginx/conf.d/
.
Doing this in one file (combined.conf
) works great :
upstream backend1 {
http://localhost:8989;
}
upstream backend2 {
http://localhost:8990;
}
server {
location /backend1/ {
proxy_pass http://backend1;
}
location /backend2/ {
proxy_pass http://backend2;
}
However, when splitting into 2 files, one of the redirects fails systematically:
backend1.conf
:upstream backend1 { http://localhost:8989; } server { location /backend1/ { proxy_pass http://backend1; }
backend2.conf
:upstream backend2 { http://localhost:8990; } server { location /backend2/ { proxy_pass http://backend2; }
So my question is : can an http
node have 2 different server
childs ?
Nginx documentation says nothing about it.
Other people seem to have succeeded with this kind of architecture though :(
Nginx version is 1.1.19-1ubuntu0.1.
Thanks for any advice !