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.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI 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.
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