Welcome! Log In Create A New Profile

Advanced

host names in 1.9

May 26, 2015 06:47PM
I'm having some difficulty using the stream directive in 1.9. I may be using it wrong, so please correct me if this is incorrect or not possible.

stream {
server {
listen 1520;
server_name customhost.example.com
proxy_pass db;
}
upstream db {
server 10.100.0.104:1523;
}
}

I have multiple host names (server_name s) that I want to hit 1520 and be proxied to different upstream dbs. I have a second stream context with a different server_name and different upstream db. I can't get this to work. I think I'm missing something. How would I accomplish this? ultimate goal: reverse proxy a database connection based on host name.
Subject Author Posted

host names in 1.9

sentinel21 May 26, 2015 06:47PM

Re: host names in 1.9

Francis Daly May 26, 2015 07:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 55
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready