[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nginx
Subject:    Regex on Variable ($servername)
From:       basti <mailinglist () unix-solution ! de>
Date:       2017-10-29 10:53:23
Message-ID: 07ef84ca-f730-1279-d01a-6cf8febd53ef () unix-solution ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

i try to setup a catch all proxy server with nginx.
I want to catch domains like this but have only domainname (without
subdomain) in $domain

In this example from nginx docs domain has "fullname".

server {
    server_name ~^(www\.)?(*?<domain>*.+)$;
    root /sites/*$domain*;
}

servername: www.example.com -> $domain should be example.com

Best Regards

[Attachment #5 (text/html)]

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt> </tt><tt>Hello,</tt><tt><br>
    </tt><tt> </tt><tt><br>
    </tt><tt> </tt><tt>i try to setup a catch all proxy server with
      nginx.</tt><tt><br>
    </tt><tt> </tt><tt>I want to catch domains like this but have only
      domainname (without subdomain) in $domain</tt><tt><br>
    </tt><tt></tt><br>
    <tt><tt>In this example from nginx docs domain has "fullname".<br>
        <br>
      </tt></tt><tt>server {
    </tt><tt><br>
    </tt><tt>     server_name \
~^(www\.)?(</tt><tt><b>?&lt;domain&gt;</b></tt><tt>.+)$;  <br>
          root /sites/</tt><tt><b>$domain</b></tt><tt>;<br>
      }</tt><tt><br>
    </tt><tt></tt><br>
    <tt><tt>servername: <a class="moz-txt-link-abbreviated" \
href="http://www.example.com">www.example.com</a> -&gt; $domain should be  \
example.com</tt><tt><br>  </tt><br>
    </tt><tt>Best Regards</tt><tt> </tt>
  </body>
</html>



_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic