Setup:
I have various devices on my home network. I have used ".home" as the domain for this network. My router (ASUS - with Merlin firmware) supports basic DNS and can route "desktop.home" to the appropriate device within the network. I have a domain name "reallyreallyreallycoolname.com" which has a subdomain that points to my home network (*.home.reallyreallyreallycoolname.com).
Problem:
I want NGINX to remove the domain name from requests and send the request on to the appropriate destination based on the router's DNS table. So a request for desktop.home.reallyreallyreallycoolname.com will be sent via reverse proxy to 192.168.1.81 (or whatever IP is assigned to "desktop.home").
Attempted Solution:
I was thinking that for "server name" there could be a capture group and proxy_pass would restate it. For example:
server_name {*}.home.reallyreallyreallycoolname.com;
location\{
proxy_pass http://{\1}.home
}