Skip to content

Commit 8b52ad5

Browse files
Use SERVER_ADDR instead of HTTP_HOST in the redirect from http to https
HTTP_HOST can be manipulated via Host header and for this reason SERVER_ADDR (Server's IP address) used. Ticket: ENT-11481 Signed-off-by: Ihor Aleksandrychiev <ihor.aleksandrychiev@northern.tech>
1 parent c5cc2cc commit 8b52ad5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps-packaging/apache/httpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ SetHandler "proxy:fcgi://127.0.0.1:9000"
261261

262262
# Force https with redirection
263263
RewriteCond %{HTTPS} off
264-
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
264+
RewriteRule (.*) https://%{SERVER_ADDR}%{REQUEST_URI} [R=301,L]
265265

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

0 commit comments

Comments
 (0)