Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to return for a specific domain an error, like if the server (nginx) would not work?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Yes, here is an example of returning a 102 status code when browsing to the root of the virtual host:

location / {
    try_files =102
}

However, 102 is not a valid HTTP status code. You should select a more appropriate status code to indicate that the server is not working, such as 501.

share|improve this answer
    
try_files doesn't work for me, still 404. 501 works, but still is visible that it is an answer of nginx. –  static Jun 26 '13 at 1:27
    
You want to look at the server_tokens directive. You can use that to disable all the nginx branding. –  Darth Android Jun 26 '13 at 1:27
    
server_tokens - only on/off. nginx brand still there. I want do not server one subdomain, like the nginx would be off, not just sending 404 back. –  static Jun 26 '13 at 1:31
    
You need to point the subdomain to a different IP address then. nginx has no choice but to operate on every request which comes in on the IP that it's bound to. –  Darth Android Jun 26 '13 at 1:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.