apachexamppvhostsngrok

Access Forbidden when using xampp with ngrok for accessing a local vhost


I have set up a vhost that is working locally, I would like to access it from other devices using ngork. But I always get this message: "Access forbidden! You don't have permission to access the requested directory. There is either no index document or the directory is read-protected." when trying to access the link provided by ngrok (although locally it works fine, and I even tried to disable my firewall altogether but the problem persisted)

My vhost:

NameVirtualHost *:80

<VirtualHost security.local:80>
  ServerName security.local
  ServerAlias security.local
  DocumentRoot "E:\Websites\security\public"
  <Directory "E:\Websites\security\public">
       Order Allow,Deny
       Options All
       AllowOverride All
       Allow from all
       Require all granted
  </Directory>
</VirtualHost>

The ngrok command I use:

ngrok.exe http security.local

My hosts file:

127.0.0.1   security.local

Solution

  • I found the solution. The correct ngrok command has to be:

    ngrok http --host-header=rewrite security.local