Hi there,

While upgrading the AmazonS3 module from 7.x-1.0 to 7.x-1.1 there was an issue with the external URL generation on our https sites. After doing the upgrade the external URL was only generated with "http" instead of "https".

Our UAT server generated the external URL correctly with https but not our live server (which is load balanced).

After looking into the issue it seems that the module now checks the global variable $is_https https://github.com/justafish/drupal_amazons3/commit/5470b296b0ecc8c4b708... which is set in bootstrap.inc approx line 734:

$is_https = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on';

The $_SERVER variable stores HTTPS data differently depending on if we are on a load balancer or not, http://stackoverflow.com/questions/452375/detecting-https-requests-in-php.

A workaround to this is to force HTTPS in the amazonS3 module UI config.

Using Core 7.39.

I'm not sure if this is an amazonS3 module issue or core, but I thought I'd give a heads up here in case anyone else had this issue while upgrading to 7.x-1.1.

Cheers

Comments

dansanjou created an issue.

athaller’s picture

Hi Dansanjou:

I ran into a similar problem (with Drupal assets) prior to doing anything with s3. It might be possible that your env setup might be what's causing this.

To shed some light -- I discovered Drupal looks for $_SERVER['https'] -- which typically would be set by Apache when accessing your site on port 443. In my setup -- the LB has the SSL cert and I proxy the traffic to the server through port 80. This causes Apache to not set $_SERVER['https'] = 'on' which caused all my assets to load under a http requests.

To work around this -- I simply had to add to my settings.php $_SERVER['https'] = 'on';

Hope this helps.

-Andy