CGI.SERVER_NAME empty till CGI scope is dumped


#1

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

#2

Is server name a webserver directive?


#3

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.


#4

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


#5

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


#6

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 : https://luceeserver.atlassian.net/projects/LDEV/issues/LDEV-2123