#!/bin/bash set -euo pipefail export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y nginx php5-fpm php5-cli php5-curl git php5-dev 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 *HTTPS.*$/fastcgi_param HTTPS \$fe_https if_not_empty;/' \ /etc/nginx/fastcgi_params mkdir -p /var/lib/dokuwiki/{conf,data,lib/plugins,lib/tpl} chown -R vagrant.vagrant /var/lib/dokuwiki