How to debug why the mod_proxy is giving a “No protocol handler was valid” error

apache-2.4mod-proxyreverse-proxy

I am trying to set up Apache as a frontend proxy to a Docker app. I have done this several times in the past, but for some reason, the new Ubuntu VPS I have is not co-operating. I'm using Apache/2.4.18.

I am using this vhost:

<VirtualHost *:80>
    ServerName blog.example.com

    ProxyPass / http://127.0.0.1:8083/
    ProxyPassReverse / http://127.0.0.1:8083/

</VirtualHost>

I have enabled the necessary modules:

a2enmod proxy
a2enmod proxy_html
a2enmod xml2enc

Apache starts up fine, but I get this error in the logs, plus the standard 500 crash message in the browser:

AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

This problem is mentioned a lot on the web, but the advice basically reflects the contents of the error message, which is that I need to ensure the proxy modules are loaded. I can confirm 100% they are loaded – in fact, if I replicate the LoadModule commands in my vhost config, Apache won't start, because the modules are already loaded.

They also look loaded from here too:

$ apachectl -M | grep proxy
 proxy_module (shared)
 proxy_html_module (shared)

I can confirm the Docker app is serving an HTTP response (I don't think it's getting that far anyway):

root@agnes:~# wget localhost:8083
--2018-04-02 19:04:46--  http://localhost:8083/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8083... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7 [text/html]
Saving to: ‘index.html’

index.html                                                  100%[=========================================================================================================================================>]       7  --.-KB/s    in 0s      

2018-04-02 19:04:46 (1.20 MB/s) - ‘index.html’ saved [7/7]

root@agnes:~# cat index.html 
Hello

I am rather stuck as to what other problem I could be having. Researching the problem further is not trivial, since search engine results are drowned out by a common answer that does not seem to apply in my case.

Best Answer

You need to load mod_proxy_http to be able to proxy the http protocol.