shkoliar / magento-ngrok Goto Github PK
View Code? Open in Web Editor NEWMagento 2 module for ngrok.io service support
Home Page: https://shkoliar.com
License: MIT License
Magento 2 module for ngrok.io service support
Home Page: https://shkoliar.com
License: MIT License
Right now when using ngrok with free version it responds with different url:
Additionally you can put your own domain in pro version which is not supported as well.
I've been able to successfully load the first page of my site, but every link that is generated after that points to my usual localhost URL rather than my ngrok URL.
I notice in StoreBaseUrl::afterGetBaseUrl()
that the $result
is https://local.mydevsite.com/index.php/en_CA/
and thus isn't getting picked up in the conditional on line 48. That being said, I'm not sure that it's supposed to be since it isn't technically a base URL at that point. I also tried removing the first part of the condition to force it to use the ngrok URL, and that does work, but none of the static assets load, so I'm not able to test properly.
The only other thing I could think of was my nginx config, but I don't see anything obvious there (I've attached it in case you have time to look at it). Do you have any ideas?
I forgot to mention, my Magento version is 2.3.3. I'm sure this works on a clean install, so I'm hoping you might be able to wager a guess as to what I could look at changing.
I have Magento installed on localhost/magento2, and when I use this with ngrok it sets the base URL without /magento2 and it breaks the links
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.