当使用ngrok和MAMP Pro隧道化我的php项目时,如何获得正确的文档根目录?

当使用ngrok和MAMP Pro隧道化我的php项目时,如何获得正确的文档根目录?

问题描述:

I am trying to use ngrok to tunnel my project. It's named frontend and points to port 8888 and has a specific document root (not the default /Applications/MAMP/htdocs) When I start up my server I have no problem seeing it locally. But when I try to create a tunnel passing the command

./ngrok http frontend:8888

the url it gives me just takes me to the basic MAMP pro success page and not my website. The basic MAMP Pro site says my document root is /Applications/MAMP/htdocs so I think this might be related to the problem but I'm really not sure. I've successfully used ngrok before but not with my php project.

我正在尝试使用ngrok来隧道化我的项目。 它被命名为frontend并指向端口8888并且具有特定的文档根(不是默认的/ Applications / MAMP / htdocs)当我启动我的服务器时,我在本地看到它没有任何问题。 但是当我尝试创建一个传递命令的隧道 p>

./ ngrok http frontend:8888 p>

它给我的网址只是带我去了 基本的MAMP专业成功页面,而不是我的网站。 基本的MAMP Pro网站说我的文档根目录是/ Applications / MAMP / htdocs所以我认为这可能与问题有关,但我真的不确定。 我以前成功使用过ngrok但没有使用我的php项目。 p> div>

Was able to get it working using -host-header=rewrite

example: ngrok http -host-header=rewrite localhost:8888