Hide raw regular expression from $_SERVER['server_name']

justin nginx-forum at nginx.us
Sat Aug 3 22:07:20 UTC 2013


I am using a regular expression in a server_name:

         server_name ~^(?!web2\.)(?<account>.+)\.mydomain\.com$;

In PHP, or any language for that matter, if I:

        echo $_SERVER['server_name'];
        //~^(?!web2\.)(?.+)\.mydomain\.com$

I get the raw regular expression back. Is it possible to mask this, and
instead return the actual regular expression matchedaccount? I.E.
foo.mydomain.com.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,241519,241519#msg-241519



More information about the nginx mailing list