Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 3.25 KB

README.md

File metadata and controls

69 lines (51 loc) · 3.25 KB

NGROK/Magento Usage Guide

This repository contains instructions and resources for setting up NGROK with Magento2.

Getting Started

Before you begin, ensure you have an NGROK account. If not, sign up at ngrok.com.

Installation

Follow the platform-specific installation instructions provided in the NGROK Documentation.

Static Domain Setup

NGROK offers the ability to create a one static domains for your projects (FREE). This allows for easier access to your tunnels. Follow the steps outlined in the NGROK Blog Post to set up a static domain for your NGROK account.

Cloud Edges and Tunnel Creation

NGROK provides cloud edges for all users, enhancing performance and reliability. Learn how to utilize this feature in the NGROK Blog Post.

Modify the hosts file:

image

Ensure that you specify the port number correctly. Instead of using 9555, you have the option to use 8080 Magento NGINX config.

To create a tunnel using cloud edges:

Run the following command (replace YOUR_EDGE_HASH and the port number of magento project):

ngrok tunnel --label edge=YOUR_EDGE_HASH http://localhost:9555

image

Instert your static ngrok url to the tables via the sql:

UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/secure/base_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/unsecure/base_link_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/secure/base_link_url';

Just in case if admin url is showing 404 page:

REPLACE to yours admin path.

INSERT INTO `core_config_data`(`scope`, `scope_id`, `path`, `value`)
VALUES(
    'default', -- Or whatever your Scope is
    0,         -- Or whatever your Scope ID is
    'admin/url/custom',
    'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/magento_admin/'
);
php bin/magento setup:config:set --backend-frontname="magento_admin"
sudo rm -r pub/static/*/* && sudo rm -r var/view_preprocessed/* && bin/magento cache:f && bin/magento cache:c
bin/magento setup:upgrade && bin/magento setup:di:compile && bin/magento s:s:d -f
bin/magento indexer:reindex

Disable the default restriction page in browser:

image

  1. Open the edges and the your static app domain:

image

  1. Go to Request Headers and add the option with value
ngrok-skip-browser-warning  true