Last active
June 25, 2019 10:30
-
-
Save Tam/ff990dca1178431439fca739b7d0a5d5 to your computer and use it in GitHub Desktop.
Using ngrok with Craft CMS 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ngrok http -region=eu -host-header=my-dev-domain.local 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$isNgrok = array_key_exists('HTTP_X_ORIGINAL_HOST', $_SERVER) && strpos($_SERVER['HTTP_X_ORIGINAL_HOST'], 'ngrok'); | |
$host = $isNgrok ? ('https://' . $_SERVER['HTTP_X_ORIGINAL_HOST'] . '/') : getenv('DEFAULT_SITE_URL'); | |
return [ | |
'*' => [ | |
// ... | |
'siteUrl' => $host, | |
'baseCpUrl' => $host, | |
'aliases' => [ | |
'web' => $host, | |
], | |
], | |
// ... | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment