Welcome! Log In Create A New Profile

Advanced

Using if statements in a location block with set

Anonymous User
September 06, 2013 07:42PM
Is the following going to work as expected:

location /v1/users {
rewrite ^/users/(.*)/accounts$ /v1/users/$1/accounts break;

if ($server_name = 'js.mydomain.com') {
set $backend "api.mydomain.com";
}

if ($server_name = 'js-s.mydomain.com') {
set $backend "api-s.mydomain.com";
}

proxy_pass https://$backend;
}
SubjectAuthorPosted

Using if statements in a location block with set

Anonymous UserSeptember 06, 2013 07:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 98
Record Number of Users: 5 on November 05, 2014
Record Number of Guests: 210 on November 05, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready