LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Using ProxyPass in Apache 2.4 results in "AH00128: File does not exist:" error (https://www.linuxquestions.org/questions/linux-server-73/using-proxypass-in-apache-2-4-results-in-ah00128-file-does-not-exist-error-4175668187/)

morenz 01-22-2020 04:27 AM

Using ProxyPass in Apache 2.4 results in "AH00128: File does not exist:" error
 
Hi all,
running Apache 2.4 on Debian 10.

I need to redirect a virtual path (/some/path) to another URI (/path/to/another/uri) in a Node.js instance running on the same server, listening on port 6666

As you can see Node.js is up and running and the (empty) reply is correct.
Code:

root@test:/var/www/server-local# curl http://localhost:6666/path/to/another/uri
<html></html>

To achieve the redirection, I used a reverse proxy
Code:

<Location /some/path>
    ProxyPass http://localhost:6666/path/to/another/uri
    ProxyPassReverse http://localhost:6666/path/to/another/uri
</Location>

that's not working: 404

I have other instances of ProxyPass (with other URIs, so there's no need to check for overrides)

After a bit of headbanging and lowering the LogLevel, I discovered that I have this error in logs
Code:

[Wed Jan 22 09:42:02.592536 2020] [core:info] [pid 10570] [client a.b.c.d:58375] AH00128: File does not exist: /var/www/html/some/path
It seems that it's searching for a real directory in the file system, that obviously is not present.
I read about permission issues, but it doesn't seem to be the right path.

I'm a bit stuck. A 10-minute do-and-forget work has took me off the whole day.

Ideas?

Thanks in advance
Morenz

bathory 01-22-2020 10:15 AM

Did you restart apache after adding the reverse proxy stuff? Also you need to clear your browser cache.
If it still doesn't work, you may try the following syntax omitting the <Location ...> directive:
Code:

ProxyPass /some/path http://localhost:6666/path/to/another/uri
ProxyPassReverse /some/path http://localhost:6666/path/to/another/uri

Regards

morenz 01-30-2020 11:53 AM

Hi,
back from a devastating week.
The problem was a human error. I thought that the last part in the path was part of the path itself, but after asking to the developer, I discovered that /uri actually was the command itself, and not part of the URI.
The "real" URI stopped to previous level, so

Code:

ProxyPass /some/path/ http://localhost:6666/path/to/another/
ProxyPassReverse /some/path/ http://localhost:6666/path/to/another/

worked like a charm

Thanks for the time spent!


All times are GMT -5. The time now is 07:56 AM.