I wonder if mod_proxy is a good practice because i have an apache http server which delvier my application ressources html/css/jss and for specific url I use ProxyPass to external IP.
By example url like: a.example.com/index.html
load ressources from c:/htdocs/a/index.html
etc...
But for all url ending with /api
I have ProxyPass configuration by example for a.example/api/
I have
ProxyPass /api http://external-server-ip.com:8802/api connectiontimeout=10 timeout=2400
All this works, but I doubt if this is good practice? because actually it seems all my REST /api/...
requests go through apache then apache send them to http://external-server-ip.com:8802/api
then this external server send response to apache then apache respond to me ? This seems heavy and bad no ?
Is this common behavior: keep same domain name + load ressource from same http-server but for all REST request send+fetch proxypass to external ip depending on "subdomain"
UPDATE: I proxypass /api all to different of my BACKEND-servers which are installed on different cloud server (theses servers are mine), but I just want one domain name to all my clients to be client-name.MYURL.com
I have some clients on cloud-server-1 and others in others cloud-server-2, by example:
client-1.MYURL.com/api
until client-1000.MYURL.com/api
are proxypassed to a cloud server ip x.x.x.x:x
and client-1000.MYURL.com/api
until client-2000.MYURL.com/api
will fetch data from cloud-server ip y.y.y.y:y
and so on ... another uecase is I want create accès to my local-server-test just by accessing test.MYURL.com which have ip z.z.z.z:z
Here all external-ip are my backend-server on different places/machines/server.
And I use mod_macro to achieve this by creating virtualhost per client, this all works, the questio is best practice and how keep only ONE domaine name but redirect to selected server depending on subdomain, this allow me to have only ONE domain name + one wldcard ssl certificat etc. for all my clients