Skip to content

Commit f8ef5af

Browse files
Redirection responsibility moved from Apache to PHP
ChangeLog: Title Ticket: ENT-11481 Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
1 parent c91eb66 commit f8ef5af

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

MPF.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ By default Mission Portal listens for HTTP requests on port 80, redirecting to H
313313

314314
* Added in CFEngine 3.6.0
315315
* Class renamed from `cfe_cfengine_enterprise_enable_plain_http` to `cfe_enterprise_disable_http_redirect_to_https` in CFEngine 3.23.0, 3.21.3
316+
* Redirection responsibility moved from Apache to PHP in CFEngine 3.27.0
316317

317318
### Disable cf\_promises\_validated check
318319

cfe_internal/enterprise/mission_portal.cf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ classes:
7474
"max_spare_servers":"${php_fpm_www_pool_max_spare_servers}"
7575
}');
7676

77+
files:
78+
# http -> https redirection moved from Apache to PHP
79+
# Here the flag files are managed so that PHP will know what to do
80+
cfe_enterprise_disable_http_redirect_to_https::
81+
"/opt/cfengine/flags/."
82+
perms => mog("750", "root", "cfapache")
83+
create => "true";
84+
"/opt/cfengine/flags/plain-httpd.disabled" -> { "ENT-11481" }
85+
perms => mog("660", "root", "cfapache"),
86+
create => "true";
87+
88+
!cfe_enterprise_disable_http_redirect_to_https::
89+
"/opt/cfengine/flags/plain-httpd.disabled" -> { "ENT-11481" }
90+
delete => tidy;
91+
7792
reports:
7893
DEBUG::
7994
"Using variable default:def.php_fpm_www_pool_max_children: ${default:def.php_fpm_www_pool_max_children} instead of built-in default"

cfe_internal/enterprise/templates/httpd.conf.mustache

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,6 @@ AddType application/x-httpd-php-source php{{{vars.cfe_internal_hub_vars.php_v
280280
<IfModule rewrite_module>
281281
RewriteEngine On
282282

283-
{{^classes.cfe_enterprise_disable_http_redirect_to_https}}
284-
# Force https with redirection
285-
RewriteCond %{HTTPS} off
286-
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
287-
{{/classes.cfe_enterprise_disable_http_redirect_to_https}}
288-
289283
{{#classes.mission_portal_index_php_redirect_enabled}}
290284
# redirect from `index.php/path` to `/path`
291285
RewriteCond %{REQUEST_URI} !(.*)/api/(.*) [NC] #do not apply redirect to internal APIs for backward compatibility

0 commit comments

Comments
 (0)