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'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"><<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>></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>
> is there a way to avoid output body when a request is calling for a vhost<br>
> that not exist?<br>
><br>
> Normally when user send a request to nginx server for a server name doesn't<br>
> exits on nginx server, nginx will reply "Bad Hostname".<br>
><br>
> If you (me) add following lines :<br>
><br>
> server {<br>
> listen 80;<br>
> server_name _;<br>
> location / {<br>
> return 404;<br>
> }<br>
> }<br>
><br>
> some cases of nginx return 404, some return 403.<br>
><br>
> And in all cases, nginx return a html error page with error message in body.<br>
><br>
> Is there a way just return 404 and do not return any more error message when<br>
> user request for a server name which does not exist? OR EVEN BETTER, just<br>
> don't return anything like the server is dead to those request?<br>
><br>
> 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>