Skip to content

Commit

Permalink
ci(docker): add rule for API access
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jun 20, 2024
1 parent 8dc2740 commit 8be9873
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docker/config/apache/001-trame.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,28 @@

<Directory /deploy/server/www>
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
AllowOverride None
Require all granted
</Directory>

# 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]

</VirtualHost>

0 comments on commit 8be9873

Please sign in to comment.