Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MPF.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ By default Mission Portal listens for HTTP requests on port 80, redirecting to H

* Added in CFEngine 3.6.0
* 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
* Redirection responsibility moved from Apache to PHP in CFEngine 3.27.0

### Disable cf\_promises\_validated check

Expand Down
15 changes: 15 additions & 0 deletions cfe_internal/enterprise/mission_portal.cf
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ classes:
"max_spare_servers":"${php_fpm_www_pool_max_spare_servers}"
}');

files:
# http -> https redirection moved from Apache to PHP
# Here the flag files are managed so that PHP will know what to do
cfe_enterprise_disable_http_redirect_to_https::
"/opt/cfengine/flags/."
perms => mog("750", "root", "cfapache"),
create => "true";
"/opt/cfengine/flags/http_redirect_to_https.disabled" -> { "ENT-11481" }
perms => mog("660", "root", "cfapache"),
create => "true";

!cfe_enterprise_disable_http_redirect_to_https::
"/opt/cfengine/flags/http_redirect_to_https.disabled" -> { "ENT-11481" }
delete => tidy;

reports:
DEBUG::
"Using variable default:def.php_fpm_www_pool_max_children: ${default:def.php_fpm_www_pool_max_children} instead of built-in default"
Expand Down
6 changes: 0 additions & 6 deletions cfe_internal/enterprise/templates/httpd.conf.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,6 @@ AddType application/x-httpd-php-source php{{{vars.cfe_internal_hub_vars.php_v
<IfModule rewrite_module>
RewriteEngine On

{{^classes.cfe_enterprise_disable_http_redirect_to_https}}
# Force https with redirection
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
{{/classes.cfe_enterprise_disable_http_redirect_to_https}}

{{#classes.mission_portal_index_php_redirect_enabled}}
# redirect from `index.php/path` to `/path`
RewriteCond %{REQUEST_URI} !(.*)/api/(.*) [NC] #do not apply redirect to internal APIs for backward compatibility
Expand Down