-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #37761 - use ProxyPass and upgrade=websocket where possible
RewriteRules need special handling of some characters (esp "?"), which differs based on Apache version. Instead of going down that way, we can switch to using ProxyPass as proxying is the only thing we really need here, at least for HTTP. For WebSockets, we need to allow protocol upgrades, which modern (2.4.47+) Apache can do itself via "ProxyPass … upgrade=websocket". For older Apache (esp on EL8 and Ubuntu 20.04), we keep the RewriteRules in place. To be removed when we drop support for those targets. Co-Authored-By: Adam Ruzicka <[email protected]>
- Loading branch information
1 parent
d5d4921
commit 02766b6
Showing
6 changed files
with
96 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### File managed with puppet ### | ||
|
||
<Location <%= @cockpit_path %>> | ||
ProxyPreserveHost On | ||
|
||
RewriteEngine On | ||
RewriteCond %{HTTP:Upgrade} =websocket [NC] | ||
RewriteRule <%= @cockpit_path %>/(.*) ws://<%= @cockpit_host %>:<%= @cockpit_port %><%= @cockpit_path %>/$1 [P] | ||
|
||
ProxyPass http://<%= @cockpit_host %>:<%= @cockpit_port %><%= @cockpit_path %> | ||
</Location> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters