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

Jonathan Matthews contact at jpluscplusm.com
Sat Aug 3 22:25:14 UTC 2013


On 3 Aug 2013 23:07, "justin" <nginx-forum at nginx.us> wrote:
>
> 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.

Have you tried looking at the "Host" HTTP header?

J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130803/3b4e7675/attachment.html>


More information about the nginx mailing list