I'm trying to use apache as a proxy server to redirect some requests to a service running on a different port. I'm attempting to follow the instructions here: http://httpd.apache.org/docs/2.4/rewrite/proxy.html
I've done exactly this to install (and nothing else):
sudo apt-get install apache2
sudo a2enmod rewrite
sudo a2enmod proxy
sudo a2enmod proxy_http
Then edited /etc/apache2/httpd.conf to be:
RewriteEngine on
RewriteRule ^/(.*) http://localhost:9200/$1 [P]
ProxyPassReverse / http://localhost:9200/
Then finally, restarted apache2 (sudo service apache2 restart
). Eventually, I'll add some real conditions to that rule, but I'm just trying to test it for now.
But it's not working. curl -XGET localhost:80/foo
fails with a 404 response, curl -XGET loaclhost:9200/foo
succeeds. Nothing useful in the error log or access log.