Skip to content

Insecure file transfer on reverse proxy server because protocol is being set incorrectly #67

@vjonesmuth

Description

@vjonesmuth

Browser throws requests error on reverse proxy server setups or load balanced servers because protocol was set incorrectly. I fixed this locally by adding to our craft/config/general.php :

// restore reverse proxy forwarding headers to support craft and plugin
// functionality that is depending on default server global attributes
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$_SERVER['HTTPS'] = true;
$_SERVER['SERVER_PORT'] = 443;
}

This issue should be able to be resolved by updating GoogleMaps_TemplateService.php function isSecure() to accommodate HTTP_X_FORWARDED_PROTO being set.

This should be able to be cleared up as well by removing the isSecure function all together and on line 19 of GoogleMaps_TemplatesService.php removing the protocol variable are starting the script tag with "//" to let the server decide how to send the request. ex. : craft()->templates->includeJsFile('//maps.google.com/maps/api/js?sensor=true&libraries=geometry'.($key ? 'key='.$key : ''));

This is the error message that was displayed on our staging server with the reverse proxy while editing a matrix field.
screen shot 2016-09-23 at 2 29 24 pm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions