tl;dr can the nginx server_name
be different depending upon the client connecting IP address?
I have a nginx server that serves HTTP + HTTPS traffic to the local network and the public Internet. I want the server_name
value to be different for local network clients and public Internet clients.
Local network clients are in the CIDR range 192.168.1.0/24
.
The pseudo-code logic is:
if $client_IP in 192.168.1.0/24 then
server_name = www.local
else
server_name = www.my-website.com
endif
Is this possible?