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;
}
Subject Author Posted

Using if statements in a location block with set

Anonymous User September 06, 2013 07:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 7 on October 18, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready