CGI.SERVER_NAME empty till CGI scope is dumped

What on earth could cause CGI variables to be empty, but then magically fill in when the whole scope is dumped ?
Why is server_name behaviour different to http_host ?!?

Lucee 5.2.x in Docker on Amazon.

<cfdump var="#CGI.http_host#"/>
<cfdump var="#CGI.server_name#"/>
<cfdump var="#CGI.SERVER_NAME#"/>
<cfdump var="#CGI#" expand="false"/>
<cfdump var="#CGI.http_host#"/>
<cfdump var="#CGI.server_name#"/>
<cfdump var="#CGI.SERVER_NAME#"/>

this prints

string	dev.eepartnerportal.co.uk
string	
string	
CGI Scope (writable)
Entries: 62
string	dev.eepartnerportal.co.uk
string	dev.eepartnerportal.co.uk
string	dev.eepartnerportal.co.uk

Is server name a webserver directive?

What’s a webserver directive ?

We’ve got Lucee behind Nginx, configured for name based virtual hosts using mod_cfml, if that’s what you mean.

Generally speaking, http_host comes from the request, server_name is from the webserver config, but it may vary depending on things…

By why does cfdump() change the result ? Surely this is a bug I should log ?

This occurs when the lucee-server.xml has ‘cgi-readonly=“false”’ - removing this aspect of our config restores the expected behaviour.

Still makes no sense. Logged a bug : Lucee Development - Issues - Lucee