Nginx upstream for nested proxy_pass location
up vote
0
down vote
favorite
I have this location in my config. I have two servers, primary and backup. I want to add an upstream so if the primary server is up and running all the v1 calls go to the primary otherwise it goes to the backup server
I have the upstream like this but it doesn't work
upstream backend {
server abc.123.com;
server abc.456.com backup;
}
location /v1/ {
proxy_pass https://backend;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
I am getting this error with the above configuration
nginx error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol
If I do this and call any /v1/anything it throws 404
upstream backend {
server abc.123.com:443;
server abc.456.com:443 backup;
}
but If I remove the upstream and do this it works fine
location /v1 {
proxy_pass https://abc.123.com/v1;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
nginx nginx-location proxypass nginx-reverse-proxy nginx-config
add a comment |
up vote
0
down vote
favorite
I have this location in my config. I have two servers, primary and backup. I want to add an upstream so if the primary server is up and running all the v1 calls go to the primary otherwise it goes to the backup server
I have the upstream like this but it doesn't work
upstream backend {
server abc.123.com;
server abc.456.com backup;
}
location /v1/ {
proxy_pass https://backend;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
I am getting this error with the above configuration
nginx error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol
If I do this and call any /v1/anything it throws 404
upstream backend {
server abc.123.com:443;
server abc.456.com:443 backup;
}
but If I remove the upstream and do this it works fine
location /v1 {
proxy_pass https://abc.123.com/v1;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
nginx nginx-location proxypass nginx-reverse-proxy nginx-config
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have this location in my config. I have two servers, primary and backup. I want to add an upstream so if the primary server is up and running all the v1 calls go to the primary otherwise it goes to the backup server
I have the upstream like this but it doesn't work
upstream backend {
server abc.123.com;
server abc.456.com backup;
}
location /v1/ {
proxy_pass https://backend;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
I am getting this error with the above configuration
nginx error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol
If I do this and call any /v1/anything it throws 404
upstream backend {
server abc.123.com:443;
server abc.456.com:443 backup;
}
but If I remove the upstream and do this it works fine
location /v1 {
proxy_pass https://abc.123.com/v1;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
nginx nginx-location proxypass nginx-reverse-proxy nginx-config
I have this location in my config. I have two servers, primary and backup. I want to add an upstream so if the primary server is up and running all the v1 calls go to the primary otherwise it goes to the backup server
I have the upstream like this but it doesn't work
upstream backend {
server abc.123.com;
server abc.456.com backup;
}
location /v1/ {
proxy_pass https://backend;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
I am getting this error with the above configuration
nginx error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol
If I do this and call any /v1/anything it throws 404
upstream backend {
server abc.123.com:443;
server abc.456.com:443 backup;
}
but If I remove the upstream and do this it works fine
location /v1 {
proxy_pass https://abc.123.com/v1;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host "";
}
nginx nginx-location proxypass nginx-reverse-proxy nginx-config
nginx nginx-location proxypass nginx-reverse-proxy nginx-config
edited Nov 9 at 0:33
asked Nov 7 at 19:17
khalid
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53196314%2fnginx-upstream-for-nested-proxy-pass-location%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown