<div dir="ltr">Adding to Jonathan suggestion with a twist:<div><br></div><div>1. Use a map directive at the http level:</div><div><br></div><div> map $host $rewrite_domain {</div><div> default 0;</div>
<div> ~www\.(?<domain>.*)$ $domain;</div><div> }</div><div><br></div><div> 2. Create a default server while leaving all vhosts using only the base domain.</div><div> </div>
<div> server {</div><div> listen 80 default_server;</div><div> </div><div> if ($rewrite_domain) {</div><div> return 301 $scheme://$rewrite_domain$request_uri;</div><div> }</div>
<div class="gmail_extra"> }</div><div class="gmail_extra"> </div><div class="gmail_extra"><div>----appa<br><br></div>
<br><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 4:47 PM, David | StyleFlare <span dir="ltr"><<a href="mailto:david@styleflare.com" target="_blank">david@styleflare.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Pardon me if I missed this in the docs...<br>
<br>
My issue is that I want to rewrite every domain and not create a server block for each.<br>
<br>
I am trying to rewrite every domain thats pointing to Nginx<br>
<br>
from <a href="http://www.server.com" target="_blank">www.server.com</a> to <a href="http://server.com" target="_blank">server.com</a><br>
<br>
currently I am doing uwsgi_pass unix://$host.sock<br>
<br>
but if the host name has the www prefix then my socket is not found...<br>
<br>
Currently I am using the default nginx.conf file with only one line added uwsgi_pass<br>
<br>
Thanks in advance for any help.<br>
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/<u></u>mailman/listinfo/nginx</a><br>
</blockquote></div><br></div></div>