我正在尝试使用“ngrok http -host-header = client1.dev 80”在我的站点目录中隧道客户端站点,访问 url 时得到 404。经过一些实验,如果我将 index.html 文件放在主目录中,它将显示该文件。不确定为什么主目录中的文件有效,而站点目录中的文件无效。我一定在这里遗漏了一些东西……有什么想法吗?
目录结构:
www
|home
|sites
| client1
| client2
...
vhost.conf:
<Directory "/www">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Virtualhost *:80>
VirtualDocumentRoot "/Users/myname/www/home/wwwroot"
ServerName home.dev
UseCanonicalName Off
</Virtualhost>
<Virtualhost *:80>
VirtualDocumentRoot "/Users/myname/www/sites/%1/wwwroot"
ServerName sites.dev
ServerAlias *.dev
UseCanonicalName Off
</Virtualhost>