I’m running Apache 2.4 on AWS Linux as httpd. I’ve a single domain, and all requests are directed via
Listen: 80 and
DocumentRoot "/var/www/html". My current domain does use SSL, with the certificates installed on the server.
I’m now at a point where I’d like to introduce a reverse proxy setup to point at another server if a directory match exists. So, for example:
http://my.domain.com/ should be show files from
http://my.domain.com/myAPI/ should be redirected to
I’ve been attempting to follow the documentation here, and some examples here, and here, but seem to wind up in various states of not being able to start the http daemon, or the daemon successfully starting but not performing any redirects because the /myAPI/ call is not being redirected.
I’ve been attempting various versions of this in
/conf/httpd.conf followed by a service restart.
#About line 44 in an otherwise largely unmodified config file #Listen 80 <VirtualHost *:80> ProxyPreserveHost on SSLProxyEngine on ServerName my.domain.com ProxyPass "/myAPI" "http://126.96.36.199:9876/" ProxyPassReverse "/myAPI" "http://188.8.131.52:9876/" </VirtualHost>
Note: I am not running a default-site.conf file. I, quite frankly, am not sure if it will make a difference, and when I’ve tried to set it up I seem to cause a litany of other issues. So if my example is achievable from the default httpd.conf I’d prefer to work in there.