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 "new_host" variable<br><br>server {<br> listen 80;<br> server_name ~(?P<new_host>.*)\.xyz\.com;<br>
error_log "/srv/logs/xyz.com.error";<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"><<a href="mailto:boris@dolgov.name">boris@dolgov.name</a>></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. <<a href="mailto:skall.paul@gmail.com">skall.paul@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I need to modify the hostname ( $host ) as follows.<br>
><br>
> Request Hostname: <a href="http://xyz.abc.example.com" target="_blank">xyz.abc.example.com</a><br>
><br>
> Required Hostname: xyz.abc<br>
><br>
> I am expecting some sort of regex function to be run on $host.<br>
><br>
> Please feel free to ask questions to know more about my requirement.<br>
</div>server<br>
{<br>
server_name ~(?P<new_host>.*)\.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>