[apache] Apache Proxy: No protocol handler was valid

I am trying to proxy a subdirectory to another server. My httpd.conf:

RewriteEngine On
ProxyPreserveHost On
RewriteRule .*subdir/ https://anotherserver/subdir/ [P]

The problem is that Apache is always logging this:

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

So after searching the internet, I have activated these modules:

LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_express_module modules/mod_proxy_express.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_html_module modules/mod_proxy_html.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
LoadModule rewrite_module modules/mod_rewrite.so

(I know that I don't need all of them but I just activated them to be sure I am not missing one)

But this error still appears and clients get a HTTP 500.

How can I fix this?

This question is related to apache httpd.conf apache-modules apache2.4

The answer is


I tried to get an uwsgi:// working, but somehow the manual thought it was clear to me that I actually needed mod_proxy_uwsgi. It was not. Here is how you do it: How to compile mod_proxy_uwsgi or mod_uwsgi?


In my case, all modules were correctly set up (https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension is a good starter) & I had the redirection working for a base url, let's say /mysite/ but I got the errors for any child ULR, let's say /mysite/login/

http://reverse-proxy.dns.com/mysite/ was properly redirected to the remote servers while http://reverse-proxy.dns.com/mysite/login/ failed at the Apache2 reverse proxying with OP's error message.

The issue was the ending / character in the proxypass directive "/mysite/". Working configuration for child URL is :

<Proxy balancer://mysite_cluster>
    BalancerMember http://192.x.x.10:8080/mysite
    BalancerMember http://192.x.x.11:8080/mysite
</Proxy>
<VirtualHost *:80>
    [...]
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass "/mysite" "balancer://mysite_cluster"
    ProxyPassReverse "/mysite" "balancer://mysite_cluster"       
</VirtualHost>

Trailing / truly are tricky.


I am posting an answer here, since I had the same error message for a different reason.

This error message can happen, for example, if you are using apache httpd to proxy requests from a source on protocol A to target on protocol B.

Here is the example of my situation:

AH01144: No protocol handler was valid for the URL /sockjs-node/info (scheme 'ws').

In the case above, what was happening was simply the following. I had enabled mod proxy to proxy websocket requests to nodejs based on path /sockjs-node.

The problem is that node does not use the path /sockjs-node for websocket requests exclusively. It also uses this path for hosting REST entrypoints that deliver information about websockets.

In this manner, when the application would try to open http://localhost:7001/sockjs-node/info, apache httpd would be trying to route the rest call from HTTP protocol to to a Webscoket endpoint call. Node did not accept this.

This lead to the exception above.

So be mindful that even if you enable the right modules, if you try to do the wrong forwarding, this will end with apache httpd informing you that the protocol you tried to use on the target server is not valid.


In my case, I needed proxy_ajp module.

a2enmod proxy proxy_http proxy_ajp 

For me all above-mentioned answers was enabled on xampp still not working. Enabling below module made virtual host work again

LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

To clarify for future reference, a2enmod, as is suggested in several answers above, is for Debian/Ubuntu. Red Hat does not use this to enable Apache modules - instead it uses LoadModule statements in httpd.conf.

More here: https://serverfault.com/questions/56394/how-do-i-enable-apache-modules-from-the-command-line-in-redhat

The resolution/correct answer is in the comments on the OP:

I think you need mod_ssl and SSLProxyEngine with ProxyPass – Deadooshka May 29 '14 at 11:35

@Deadooshka Yes, this is working. If you post this as an answer, I can accept it – das_j May 29 '14 at 12:04


This was happening for me in my Apache/2.4.18 (Ubuntu) setup. In my case, the error I was seeing was:

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

The configuration related to this was:

  ProxyPass /~socket.io/ ws://127.0.0.1:8090/~socket.io/
  ProxyPassReverse /~socket.io/ ws://127.0.0.1:8090/~socket.io/

"No protocol handler was valid for the URL /~socket.io/" meant that Apache could not handle the request being sent to "ws://127.0.0.1:8090/~socket.io/"

I had proxy_http loaded, but also needed proxy_wstunnel. Once that was enabled all was good.


For my Apache2.4 + php5-fpm installation to start working, I needed to activate the following Apache modules:

sudo a2enmod proxy
sudo a2enmod proxy_fcgi

No need for proxy_http, and this is what sends all .php files straight to php5-fpm:

<FilesMatch \.php$>
    SetHandler "proxy:unix:/var/run/php5-fpm.sock|fcgi://localhost"
</FilesMatch>

Examples related to apache

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer

Examples related to httpd.conf

How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details httpd-xampp.conf: How to allow access to an external IP besides localhost? how to configure apache server to talk to HTTPS backend server? Apache Proxy: No protocol handler was valid Forbidden You don't have permission to access / on this server How to automatically redirect HTTP to HTTPS on Apache servers? Configure Apache .conf for Alias Apache could not be started - ServerRoot must be a valid directory and Unable to find the specified module Lost httpd.conf file located apache

Examples related to apache-modules

Apache Proxy: No protocol handler was valid

Examples related to apache2.4

how to fix stream_socket_enable_crypto(): SSL operation failed with code 1 Apache Proxy: No protocol handler was valid Apache2: 'AH01630: client denied by server configuration'