You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JanJambor discussed with the paperwork team an issue where absolute URLs in Paperwork weren't being generated properly in his Sandstorm package. The problem seemed to be that $_SERVER['https'] needs to be set to on for Paperwork/Laravel to figure things out properly, but that doesn't happen with his nginx etc. setup.
adjust vagrant-spk's "LEMP" (Linux ENginx MySQL PHP) configuration to handle this on behalf of frameworks, setting $_SERVER['https'] to on if the X-Forwarded-Proto is https. Having said that, I haven't dug into the sandstorm-http-bridge setup enough to find out if that's going to be feasible.
The text was updated successfully, but these errors were encountered:
paulproteus
changed the title
Test that app URLs are generated in the face of HTTPS
Test that app URLs are generated properly in the face of HTTPS
Apr 26, 2015
if (isset($headers['X-Sandstorm-Base-Path'])) {
$sandstorm_base_path = $headers['X-Sandstorm-Base-Path'];
}
if ('https' == substr($sandstorm_base_path, 0, 5)) {
$_SERVER['HTTPS'] = 'on';
}
I like this a lot.
I also think it should be part of the "Sandstorm vagrant-spk LEMP platform" that it always runs PHP with some environment variable indicating that the app is running within Sandstorm, so that PHP apps can reliably detect if to use their Sandstorm-specific code paths or not, but maybe that's an issue for a separate ticket.
So, PHP apps can look for _SERVER['HTTP_X_SANDSTORM_BASE_PATH'], which will be present if running under sandstorm, since we'll forward all headers that sandstorm-http-bridge passes on.
I've a patch forthcoming that does the appropriate thing for the embedded nginx, so it php5-fpm has HTTPS set if sandstorm-http-bridge passed on X-Forwarded-Proto: https.
I've tested the CSS absolute path using _SERVER['HTTP_X_SANDSTORM_BASE_PATH'] and it seems to work correctly, so that's also good.
@JanJambor discussed with the paperwork team an issue where absolute URLs in Paperwork weren't being generated properly in his Sandstorm package. The problem seemed to be that
$_SERVER['https']
needs to be set toon
for Paperwork/Laravel to figure things out properly, but that doesn't happen with his nginx etc. setup.(Full discussion here: paperwork/paperwork#281)
My suggestion is that we should
$_SERVER['https']
toon
if theX-Forwarded-Proto
ishttps
. Having said that, I haven't dug into thesandstorm-http-bridge
setup enough to find out if that's going to be feasible.Relevant links:
The text was updated successfully, but these errors were encountered: