We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bf8f4cd + df807ef commit 630f148Copy full SHA for 630f148
1 file changed
config/bootstrap.php
@@ -142,8 +142,18 @@
142
*/
143
$fullBaseUrl = Configure::read('App.fullBaseUrl');
144
if (!$fullBaseUrl) {
145
+ /*
146
+ * When using proxies or load balancers, SSL/TLS connections might
147
+ * get terminated before reaching the server. If you trust the proxy,
148
+ * you can enable `$trustProxy` to rely on the `X-Forwarded-Proto`
149
+ * header to determine whether to generate URLs using `https`.
150
+ *
151
+ * See also https://book.cakephp.org/4/en/controllers/request-response.html#trusting-proxy-headers
152
+ */
153
+ $trustProxy = false;
154
+
155
$s = null;
- if (env('HTTPS')) {
156
+ if (env('HTTPS') || ($trustProxy && env('HTTP_X_FORWARDED_PROTO') === 'https')) {
157
$s = 's';
158
}
159
0 commit comments