Welcome! Log In Create A New Profile

Advanced

Will this work, is it the best way?

Steve Wilson
January 30, 2015 06:58AM
Hi,

Slightly complicated setup with 2 nginx servers.

server1 has a public ipv4 address using proxy_pass to server2 over ipv6
which only has a public ipv6, this then has various upstreams for each
subdomain.

ipv6 capable browsers connect directly to server2, those with only ipv4
will connect via server1.

I'm currently considering something like the below config.


server1 - proxy all subdomain requests to upstream ipv6 server:

http {
server_name *.example.com;
location / {
proxy_pass http://fe80::1337;
}
}

server2:

http {
server_name ~^(?<subdomain>\w+)\.example\.com$;
location / {
proxy_pass http://$subdomain
}

upstream subdomain1 {
server 127.0.0.1:1234;
}
}

The theory here is that each subdomain and upstream would match, meaning
that when adding another upstream it would just need the upstream{}
block configuring and automatically work.

I realise there's dns stuff etc but that's out of scope for this list
and I can deal with that.

Does this seem sound? It's not going to see major usage but hopefully
this will reduce work when adding new upstreams.

If you've a better way to achieve this please let me know.

Steve.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Will this work, is it the best way?

Steve Wilson January 30, 2015 06:58AM

Re: Will this work, is it the best way?

Lloyd Chang January 31, 2015 11:24AM

Re: Will this work, is it the best way?

Steve Wilson January 31, 2015 07:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 259
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready