【发布时间】:2016-10-03 08:00:04
【问题描述】:
我想让 ngrok 在我的本地服务器上使用 php 脚本,但在加载后出现 502 错误:
502 错误网关 服务器返回无效或不完整的响应。
我已经完成了以下操作 - 在我的 /etc/hosts 中有一行
127.0.0.1 test.dev
此外,为该本地域启用了一个虚拟主机:
cat /etc/apache2/sites-enabled/test.conf
<VirtualHost *:80>
ServerName test.dev
DocumentRoot /var/www/test
ErrorLog ${APACHE_LOG_DIR}/error-test.log
CustomLog ${APACHE_LOG_DIR}/access-test.log combined
</VirtualHost>
当我将 index.html 文件放入我的 /var/www/test 目录运行时
ngrok http -host-header=rewrite test.dev:80
完美运行!
但是,如果我将 index.html 重命名为 index.php,则会出现上面的加载错误。
我在 Ubuntu 14.04 上使用 ngrok 版本 2.0.25。
我做错了什么?
【问题讨论】:
-
您介意将您的解决方案移至答案吗?这将有助于表明这个问题确实有解决方案。
-
@peter 我已将其作为社区答案。