Edit in Apache config file a Redirect
line to target API server.
Ensure Rewrite
lines remains commented for now.
For instance:
Redirect "/heos-api-server" "http://192.168.1.90:5000/"
# xor
Redirect "/heos-api-server" "http://local.nas.coulombel.net:5000/"
Redirect "/heos-api-server" "http://localhost:5000/"
Would only work if the client browser is located on same machine where API server is running.
cd apache-setup
sudo ./purge.sh # Reset Apache2 configuration
sudo ./setup.sh # Setup Apache2
sudo systemctl status apache2
Opening a browser developer tool we can see we have 2 round-trip (http code
: 302 and 200).
The client browser is doing the call directly to API server where we want Apache to make direct call to API server.
This would also simplify setup process: cf. previous Warning on IP/FQDN.
We should use RewriteRule in heos.conf.
Comment Redirect
lines and add a RewriteRule
line, for instance
RewriteRule "^/heos-api-server/(.*)$" "http://local.nas.coulombel.net:5000/$1" [P,NC]
# xor
RewriteRule "^/heos-api-server/(.*)$" "http://localhost:5000/$1" [P,NC]
and trigger installation.
Note this feature requires to enable module: rewrite, proxy, proxy_http in setup.sh.