Right now i have nginx 0.8.54. Configuration was :
server_name _; but even with with listen 80 default; or server_name "" ; behavior seems incorrect.
Normally if you have default virtual host and you access the server via ip then SERVER_NAME should return an ip address or if a domain is mapped that domain to be returned. Right now it returns what is set as server_name which seems incorrect behavior to me, which is "" or _ depending to what is set.
More if you have:
server_name set to example.com and www.example.com; It'll always return example.com
Is there any way to set the fastcgi_param so that SERVER_NAME is set to the HOST from client request, or to default on SERVER_ADDR if this is not found?