diff --git a/vagrant-spk b/vagrant-spk index aeaa949..9f44203 100755 --- a/vagrant-spk +++ b/vagrant-spk @@ -130,7 +130,7 @@ LEMP_SETUP_SCRIPT = r"""#!/bin/bash export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y nginx php5-fpm php5-mysql mysql-server -sudo unlink /etc/nginx/sites-enabled/default +unlink /etc/nginx/sites-enabled/default cat > /etc/nginx/sites-available/sandstorm-php < /etc/nginx/conf.d/50sandstorm.conf << EOF + # Trust the sandstorm-http-bridge's X-Forwarded-Proto. + map \$http_x_forwarded_proto \$fe_https { + default ""; + https on; + } +EOF +# Adjust fastcgi_params to use the patched fe_https +sed --in-place='' \ + --expression 's/^fastcgi_param\tHTTPS.*$/fastcgi_param\tHTTPS\t\t\$fe_https if_not_empty;/' \ + /etc/nginx/fastcgi_params """ LEMP_LAUNCHER_SCRIPT = r"""#!/bin/bash