magento-ngrok icon indicating copy to clipboard operation
magento-ngrok copied to clipboard

infinite redirects

Open eraq opened this issue 4 years ago • 7 comments

First I want to say thank you for building this and making it public. I very much appreciate it. I've been having some issues getting this to work correctly.

I'm running magento2 in wamp with a virtual host name 'http://magento.local' which works correctly loading magento at that url. I am not forcing secure url on frontend or admin. When I go to the ngrok 'http://xxx.ngrok.io' url, magento loads the homepage but with all css and js resources broken as they point to the local url of 'http://magento.local and are blocked by cross domain origin'. So of course now I install and enable this module.

with the module installed and enabled and cache cleared, setup upgrade and di compile run. index reindexed etc.

At the Ngrok url http://xxx.ngrok.io the I get an infinite 302 redirect loop back to that same ngrok url

hitting a static php file directly 'http://xxx.ngrok.io/ngroktest/test.php' it does return a successful 200

When I log __METHOD__ at the top of Shkoliar\Ngrok\Plugin\Model::afterGetBaseUrl, I see that the method is running, when I comment out the method, the homepage loads but with all resources blocked pointing to the 'magento.local' path.

I have disabled and cleared all caches, I have run cache:clean and cache:flush, setup:update and di:compile along with index:reindex and static-content:deploy -f. I have deploy mode in developer. I have tried this with rewrite on and off. I have tried clearing browser cache and cookies, and using different browsers I never used before. I am running ngrok like so ngrok http -host-header=magento.local 80

Is there something else I am missing?

eraq avatar Apr 29 '20 19:04 eraq