Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following scenario:

There are multiple domains, which where used by a service which has been shut down a while ago. Hence there are possibly still clients requesting the service I want all of the domains pointing to one central VHost (no problem until here):

The requesting client expects, depending on its endpoint, a specific answer - sometimes even with a (custom) responsebody (otherwise the client would keep trying to reach the service).

e.g.:

#requesting endpoint:
super.service.com/gimme200/

#expects:
Status: 200
responsebody: {"state":"ok"}

in contrast

#requesting endpoint:
super.service.com/gimme400/

#expects:
Status: 400
responsebody: {"success":"error","message":"An error has occured."}

Now this central VHost should:

  1. answer every request according to what the requestor expects (so I want to define the rules for a specific endpoint and the associated status/responsebody)
  2. log every request in a separate logfile
  3. any other request, expect those from the defined endpoints should be answered with 500.

How can I achieve this?

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.