lando / pantheon

The Official Lando Pantheon plugin.
https://docs.lando.dev/pantheon
GNU General Public License v3.0
11 stars 18 forks source link

Pantheon recipe support for pantheon HTTPS #51

Closed nterbogt closed 2 years ago

nterbogt commented 6 years ago

As per https://pantheon.io/docs/domains/ Pantheon suggests the use of the following for HTTPS redirection.

  if (!isset($_SERVER['HTTP_USER_AGENT_HTTPS'])
      || $_SERVER['HTTP_USER_AGENT_HTTPS'] != 'ON' ) {

The pantheon recipe doesn't support this variable which I assume is configured at an appserver level. Could we please have it added so that I don't have to do this (which is a hack and still prone to error):

$pantheon_not_https = !isset($_SERVER['HTTP_USER_AGENT_HTTPS']) || $_SERVER['HTTP_USER_AGENT_HTTPS'] != 'ON';
$lando_not_https = !isset($_SERVER['REQUEST_SCHEME']) || $_SERVER['REQUEST_SCHEME'] != 'https';
  if ($pantheon_not_https && $lando_not_https) {
pirog commented 6 years ago

@nterbogt this is already supported on Lando. See relevant codes: https://github.com/lando/lando/blob/master/plugins/lando-recipes/recipes/pantheon/nginx.conf#L65 https://github.com/lando/lando/blob/master/plugins/lando-services/services/nginx/fastcgi_params#L13

And screenshot of a Pantheon site i pulled down JUST FOR YOU to test this out screen shot 2018-03-14 at 7 06 15 pm

It's worth pointing out that i think this var is only available if you are routing to your site via a proxy (eg the varnish edge or ssl termination endpoint) so you should not expect to see it if you are accessing nginx directly. The easy way to do this is just use the *.lndo.site address instead of the localhost one