Skip to content

Commit

Permalink
Merge pull request #540 from carbonin/add_remote_console_proxy
Browse files Browse the repository at this point in the history
Add httpd config for rewriting remote consoles to the correct service
  • Loading branch information
bdunne authored Jun 8, 2020
2 parents e86882c + 7c8768b commit 457ba08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manageiq-operator/pkg/helpers/miq-components/httpd_conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ Options SymLinksIfOwnerMatch
ProxyPass /api http://web-service:3000/api
ProxyPassReverse /api http://web-service:3000/api
RewriteCond %{REQUEST_URI} ^/ws/console [NC]
RewriteCond %{HTTP:UPGRADE} ^websocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://remote-console:3000%{REQUEST_URI} [P,QSA,L]
ProxyPassReverse /ws/console ws://remote-console:3000/ws/console
# Ensures httpd stdout/stderr are seen by 'docker logs'.
ErrorLog "| /usr/bin/tee /proc/1/fd/2 /var/log/httpd/error_log"
CustomLog "| /usr/bin/tee /proc/1/fd/1 /var/log/httpd/access_log" common
Expand Down
6 changes: 6 additions & 0 deletions templates/app/httpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ objects:
ProxyPass /api http://web-service:3000/api
ProxyPassReverse /api http://web-service:3000/api
RewriteCond %{REQUEST_URI} ^/ws/console [NC]
RewriteCond %{HTTP:UPGRADE} ^websocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://remote-console:3000%{REQUEST_URI} [P,QSA,L]
ProxyPassReverse /ws/console ws://remote-console:3000/ws/console
# Ensures httpd stdout/stderr are seen by 'docker logs'.
ErrorLog "| /usr/bin/tee /proc/1/fd/2 /var/log/httpd/error_log"
CustomLog "| /usr/bin/tee /proc/1/fd/1 /var/log/httpd/access_log" common
Expand Down

0 comments on commit 457ba08

Please sign in to comment.