I have configured my nginx vhosts with a regex in server_name. nginx shows the raw regex in logs and in params passed to php-fpm (I know there's $_SERVER['HTTP_HOST']
with a real value, that's not an issue). My question is how can I get nginx to put the real hostname to logs, instead of the regex.
The server_name directive looks like this:
server_name ~^(:?(?<second>.+)\.)?(?<domain>[^.]+\.[^.]+)$;