Ensure your site URL's use @web
(I know it's not recommended, but that's the only way I could get it to work).
Change it back to $DEFAULT_SITE_URL
(or whatever you had before) for production.
Last active
May 16, 2019 10:17
-
-
Save Tam/5f1e8b7c9e809905f3ab5eef4cd53617 to your computer and use it in GitHub Desktop.
Craft CMS Ngrok w/ Docker
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 dev.example.com:443 -host-header=dev.example.com -region=eu |
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, | |
'aliases' => [ | |
'web' => $host, | |
], | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment