2

When I make a call using Postman to my API - which is behind a reverse proxy using Apache 2.2 - that returns a 404, I get the standard 404 Not Found html returned instead of the error from the API.

How can I configure Apache to return the error from the API instead of serving it's own HTML?

The route lives inside a <Location> block:

<Location /service/api>
    ProxyPass http://docker1:6001
    ProxyPassReverse http://docker1:6001
</Location>

An example 404 call would be http://example.com/service/api/things/1234.

2
  • You might try the ProxyErrorOverride directive, which should pass through the error as-is when set to off (the default, in most cases). Commented Apr 22, 2019 at 22:22
  • @AfroThundr That's exactly what I ended up doing. Turning it off allowed the settings I had inside the docker1 box to work properly. If you want to answer it properly I'll mark it as accepted. Commented Apr 24, 2019 at 8:58

1 Answer 1

1

From my comment earlier:

You might try the ProxyErrorOverride directive, which should pass through the error as-is when set to off (the default, in most cases).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.