dragonlew9876
dragonlew9876
2017-01-19 15:52

当使用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.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dongshao5573 dongshao5573 4年前

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

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

    点赞 评论 复制链接分享