I had no issues running this on 1.27.4 albeit on Ubuntu. Its a simplistic setup on my end but I was able to test locally and remotely to Nginx.
Are requests using the appropriate host header? If you have some verbose access logs you can see if the the correct header is being presented at request.
root@nginx03:/etc/nginx/conf.d# nginx -v
nginx version: nginx/1.27.4
root@nginx03:/etc/nginx/conf.d# cat 007.lan.conf proxy01.007.lan.conf
server {
server_name .007.lan;
listen 80;
location / {
return 200 "\n007.lan domain\n";
add_header Content-Type text/plain;
}
}
server {
server_name proxy01.007.lan;
listen 80;
location / {
return 200 "\nproxy01.007.lan domain\n";
}
}
root@nginx03:/etc/nginx/conf.d# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@nginx03:/etc/nginx/conf.d# systemctl restart nginx
### Local cURL
root@nginx03:/etc/nginx/conf.d# curl -v http://127.0.0.1 -H "Host: proxy01.007.lan"
* Trying 127.0.0.1:80...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: proxy01.007.lan
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.27.4
< Date: Sun, 02 Mar 2025 16:38:40 GMT
< Content-Type: application/octet-stream
< Content-Length: 24
< Connection: keep-alive
<
proxy01.007.lan domain
* Connection #0 to host 127.0.0.1 left intact
root@nginx03:/etc/nginx/conf.d# curl -v http://127.0.0.1 -H "Host: 007.lan"
* Trying 127.0.0.1:80...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: 007.lan
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.27.4
< Date: Sun, 02 Mar 2025 16:38:47 GMT
< Content-Type: application/octet-stream
< Content-Length: 16
< Connection: keep-alive
< Content-Type: text/plain
<
007.lan domain
* Connection #0 to host 127.0.0.1 left intact
### Remote cURL
curl -v http://10.65.8.38 -H "Host: 007.lan"
* Trying 10.65.8.38:80...
* Connected to 10.65.8.38 (10.65.8.38) port 80
> GET / HTTP/1.1
> Host: 007.lan
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Server: nginx/1.27.4
< Date: Sun, 02 Mar 2025 16:43:41 GMT
< Content-Type: application/octet-stream
< Content-Length: 16
< Connection: keep-alive
< Content-Type: text/plain
<
007.lan domain
* Connection #0 to host 10.65.8.38 left intact
curl -v http://10.65.8.38 -H "Host: proxy01.007.lan"
* Trying 10.65.8.38:80...
* Connected to 10.65.8.38 (10.65.8.38) port 80
> GET / HTTP/1.1
> Host: proxy01.007.lan
> User-Agent: curl/8.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Server: nginx/1.27.4
< Date: Sun, 02 Mar 2025 16:43:47 GMT
< Content-Type: application/octet-stream
< Content-Length: 24
< Connection: keep-alive
<
proxy01.007.lan domain
* Connection #0 to host 10.65.8.38 left intact