Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to create an Apache or nginx server which simulates the response codes I want? If it is, how hard is to setup and accomplish that in Mac OS?


share|improve this question
Do you want to programmatically send different response to a client depedning on the request content, or do you wanto simply send (for example) a 500 to every request that comes in? – SmallClanger Jan 21 '11 at 15:56
up vote 0 down vote accepted

I don't know of any normal webserver that does that, but it's certainly possible to achieve that with mod_python:

This requires a little programming, but you just need to return appropriate code from the handler() function (which normally handles HTTP requests). I have quite often done this sort of stuff while web app programming and it just works.

share|improve this answer

Your Answer


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.