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?


  • 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? Jan 21, 2011 at 15:56

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .