2

I want to access my local Magento server on public URL , I have created a shared link with ngrook, and it works, but all assets are with my test domain?

Tried database unsecure URL change, but then I get TOO MANY REDIRECTS.

1
  • I have answered the solution, but next time please be more informative. Dec 6, 2018 at 14:53

1 Answer 1

1

Update your base urls form core_config_data table.

  • Url with http:

    UPDATE `core_config_data` SET `value` = 'http://ngrok.io/your_url/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';

  • Url with https:

    UPDATE `core_config_data` SET `value` = 'https://ngrok.io/your_url/' WHERE `core_config_data`.`path` = 'web/secure/base_url';

  • Clear Magento Cache:

    php bin/magento cache:flush

Another Solution For LEMP:

Download ngrok for Linux/Ubuntu & check doc from https://dashboard.ngrok.com/get-started/setup

cd /home/user/Downloads/ngrok-stable-linux-amd64
./ngrok http http://www.magento2.lan/

sudo nano /etc/nginx/sites-available/magento2.lan

server {
          listen 80;
         # server_name www.magento2.lan;
          server_name 203fb3da8b95.ngrok.io;

          set $MAGE_ROOT /var/www/html/magento2.lan;
          include /var/www/html/magento2.lan/nginx.conf.sample;

 }

sudo nano /etc/hosts:

#127.0.0.1 www.magento2.lan 127.0.0.1 203fb3da8b95.ngrok.io

SELECT * FROM `core_config_data` where value like "%http%"

Change url

www.magento2.lan/ to 203fb3da8b95.ngrok.io

Clean cache u may run :

rm -rf var/cache/* var/tmp/_cache var/composer_home/cache/* var/view_preprocessed/* var/page_cache/* var/report/* var/log/* generated/code/*  pub/static/frontend/* pub/static/adminhtml/* pub/static/_cache/*
php bin/magento s:up
php bin/magento setup:di:compile
php bin/magento c:c
7
  • Have You tried this by Yourself, I told that changing this, cause me "Too many redirects" error Dec 6, 2018 at 14:56
  • Yes. Kindly clear cache and try. php bin/magento cache:flush Dec 6, 2018 at 14:58
  • Check 7eabc626.ngrok.io same as was. Dec 6, 2018 at 15:04
  • Can you map a static file with ngrok and show me? Dec 6, 2018 at 15:09
  • What do you mean static file with ngrok? Specify please Dec 6, 2018 at 15:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.