From f40d5a705ad1cb84d34f299d02cad74b1cbc2794 Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Mon, 26 Aug 2024 16:07:24 +0200 Subject: [PATCH] Fixes #37761 - Allow rewrites needed for cockpit integration --- spec/classes/plugin/remote_execution_cockpit_spec.rb | 2 +- templates/cockpit-apache-ssl.conf.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/classes/plugin/remote_execution_cockpit_spec.rb b/spec/classes/plugin/remote_execution_cockpit_spec.rb index 4913e6d01..402f03f0f 100644 --- a/spec/classes/plugin/remote_execution_cockpit_spec.rb +++ b/spec/classes/plugin/remote_execution_cockpit_spec.rb @@ -71,7 +71,7 @@ class {'foreman': .without_content .with_ssl_content(%r{^$}) .with_ssl_content(%r{^ RewriteRule /webcon/\(\.\*\) ws://127\.0\.0\.1:19090/webcon/\$1 \[P\]$}) - .with_ssl_content(%r{^ RewriteRule /webcon/\(\.\*\) http://127\.0\.0\.1:19090/webcon/\$1 \[P\]$}) + .with_ssl_content(%r{^ ProxyPass http://127\.0\.0\.1:19090/webcon/$}) end end diff --git a/templates/cockpit-apache-ssl.conf.erb b/templates/cockpit-apache-ssl.conf.erb index 91fe9cadc..477ff80ad 100644 --- a/templates/cockpit-apache-ssl.conf.erb +++ b/templates/cockpit-apache-ssl.conf.erb @@ -6,6 +6,6 @@ RewriteEngine On RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule <%= @cockpit_path %>/(.*) ws://<%= @cockpit_host %>:<%= @cockpit_port %><%= @cockpit_path %>/$1 [P] - RewriteCond %{HTTP:Upgrade} !=websocket [NC] - RewriteRule <%= @cockpit_path %>/(.*) http://<%= @cockpit_host %>:<%= @cockpit_port %><%= @cockpit_path %>/$1 [P] + + ProxyPass http://<%= @cockpit_path %>:<%= cockpit_port %><%= @cockpit_path %>