Hi,<br><br>I have tried the following config, but it is generating error while restarting the server.<br><br><b>Error: </b>[emerg]: unknown &quot;new_host&quot; variable<br><br>server {<br>  listen 80;<br>  server_name ~(?P&lt;new_host&gt;.*)\.xyz\.com;<br>
  error_log &quot;/srv/logs/xyz.com.error&quot;;<br>  <br>  gzip on;<br>  default_type  text/html;<br>  <br>  location / {    <br>    proxy_pass         http://$new_host:80;<br>    proxy_set_header   Host              $new_host;<br>
    proxy_set_header   X-Real-IP        $remote_addr;   <br>  }   <br>}<br><br><div class="gmail_quote">On Tue, Jul 27, 2010 at 2:26 PM, Boris Dolgov <span dir="ltr">&lt;<a href="mailto:boris@dolgov.name">boris@dolgov.name</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Tue, Jul 27, 2010 at 10:12 AM, Sougata Pal. &lt;<a href="mailto:skall.paul@gmail.com">skall.paul@gmail.com</a>&gt; wrote:<br>

&gt; Hi,<br>
&gt;<br>
&gt; I need to modify the hostname ( $host ) as follows.<br>
&gt;<br>
&gt; Request Hostname:  <a href="http://xyz.abc.example.com" target="_blank">xyz.abc.example.com</a><br>
&gt;<br>
&gt; Required Hostname:  xyz.abc<br>
&gt;<br>
&gt; I am expecting some sort of regex function to be run on $host.<br>
&gt;<br>
&gt; Please feel free to ask questions to know more about my requirement.<br>
</div>server<br>
{<br>
    server_name ~(?P&lt;new_host&gt;.*)\.example\.com;<br>
    location /<br>
    {<br>
        proxy_pass ...;<br>
        proxy_set_header Host $new_host;<br>
    }<br>
}<br>
<font color="#888888"><br>
--<br>
Boris Dolgov.<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Thanks<br>Sougata Pal.<br><a href="http://in.linkedin.com/in/skallpaul">http://in.linkedin.com/in/skallpaul</a><br>Contact: +91 9051042886<br>