issue with capturing server name

Sven 'Darkman' Michels sven at
Sun Dec 12 21:26:23 MSK 2010


on i read about capturing
the servername with regular expressions. Now i used the following on nginx

  server {
    listen  [::]:80 default ipv6only=off;
    server_name ~^(?<domain>.+)\.internal\.mydomain\.tld$;

    location / {
            proxy_pass   ;
            proxy_set_header       Host $domain;


but Host is not set at all on the upstream, because it seems that nginx
doesn't get it captured. The regexp matches, i also tried with ?P<domain>
as stated on the page with no success. Anything i'm doing wrong here?

Thanks and regards,

More information about the nginx mailing list