Great.  Thanks<br><br>But then another question popup:<br><br>When use proxy_pass , if the backend server use above technique. The front-end server will return 502 error and error message html.<br><br>Is there an easy way do avoid such output? :| might not be I guess. It&#39;s a bit of tricky<br>
<br><br><div class="gmail_quote">On Sun, Dec 6, 2009 at 1:49 AM, Igor Sysoev <span dir="ltr">&lt;<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Sun, Dec 06, 2009 at 01:27:31AM +0800, tOmasEn wrote:<br>
<br>
&gt; is there a way to avoid output body when a request is calling for a vhost<br>
&gt; that not exist?<br>
&gt;<br>
&gt; Normally when user send a request to nginx server for a server name doesn&#39;t<br>
&gt; exits on nginx server, nginx will reply &quot;Bad Hostname&quot;.<br>
&gt;<br>
&gt; If you (me) add following lines :<br>
&gt;<br>
&gt;         server {<br>
&gt;             listen       80;<br>
&gt;              server_name  _;<br>
&gt;              location / {<br>
&gt;                  return 404;<br>
&gt;              }<br>
&gt;        }<br>
&gt;<br>
&gt; some cases of nginx return 404, some return 403.<br>
&gt;<br>
&gt; And in all cases, nginx return a html error page with error message in body.<br>
&gt;<br>
&gt; Is there a way just return 404 and do not return any more error message when<br>
&gt; user request for a server name which does not exist? OR EVEN BETTER, just<br>
&gt; don&#39;t return anything like the server is dead to those request?<br>
&gt;<br>
&gt; Thanks for any suggestion. I love nginx.<br>
<br>
</div></div><a href="http://nginx.org/docs/http/request_processing.html#how_to_prevent_wrong_server_names" target="_blank">http://nginx.org/docs/http/request_processing.html#how_to_prevent_wrong_server_names</a><br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><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>Tomasen<br><a href="http://twitter.com/ShooterPlayer">http://twitter.com/ShooterPlayer</a><br>