2

Is it possible to configure Apache to return content directly at a particular location? Without actually creating a file anywhere with that contents. Something like:

<location /custom-location.txt>
    <responsebody>hello world!</responsebody>
</location>
4
  • Aren't down-votes without comments to explain why frowned upon? Commented May 6, 2015 at 9:35
  • Are you wanting to originate a 200 response? What are you trying to achieve with this (eg. a maintenance curtain or similar would be better as a 503). Commented May 6, 2015 at 11:26
  • 1
    @CameronKerr so I need a specific URL to return a 200 response along with the word "UP". Just that. For all other URLs, Apache is proxying through to an application, but to get the application to respond to this particular URL is pretty difficult, so I was hoping I could do it simply in Apache configuration. Commented May 6, 2015 at 15:07
  • 1
    That sounds more like you want a monitoring URL to be excluded from your ProxyPass directive so you monitor Apache rather than both Apache and the application behind Apache... E.g. something like ProxyPass /some/app/path/status ! # excluded from proxy directive below and then your current config ProxyPass /some/app http://host:port/app - Possibly with combined with an Alias Directive so you don't have to create the whole path
    – HBruijn
    Commented May 6, 2015 at 16:13

1 Answer 1

2

As far as I know you only have that option for error messages i.e.:

ErrorDocument 404 "Sorry but the requested resource can't be found."

You must log in to answer this question.

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