From 8be9873f7e7e310b732d878eee17ec3e1fb98eea Mon Sep 17 00:00:00 2001 From: Sebastien Jourdain Date: Thu, 20 Jun 2024 13:23:54 -0600 Subject: [PATCH] ci(docker): add rule for API access --- docker/config/apache/001-trame.conf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/config/apache/001-trame.conf b/docker/config/apache/001-trame.conf index d0c0d39d..808dcd5e 100644 --- a/docker/config/apache/001-trame.conf +++ b/docker/config/apache/001-trame.conf @@ -5,21 +5,28 @@ Options Indexes FollowSymLinks - Order allow,deny - Allow from all AllowOverride None Require all granted + # Set CORS headers Header set Access-Control-Allow-Origin "*" # Handle launcher forwarding ProxyPass /launcher http://localhost:9000/paraview + ProxyPassReverse /launcher http://localhost:9000/paraview + + # Handle paraview forwarding ProxyPass /paraview http://localhost:9000/paraview + ProxyPassReverse /paraview http://localhost:9000/paraview # Handle WebSocket forwarding RewriteEngine On RewriteMap session-to-port txt:/opt/trame/proxy-mapping.txt RewriteCond %{QUERY_STRING} ^sessionId=(.*)&path=(.*)$ [NC] RewriteRule ^/proxy.*$ ws://${session-to-port:%1}/%2 [P] + + # Handle API forwarding + RewriteRule ^/api/(.*)/(.*)$ http://${session-to-port:$1}/$2 [P,L] +