我正在尝试使用Vagrant在centos/6虚拟机上设置本地web测试环境
在流浪配置中,我设置了:config.vm.network "forwarded_port", guest: 80, host: 8080
在流浪者框中,如果我输入:hostname -I,结果是10.0.2.15
In the vagrant box, nginx is already set and I do have a SSL certification and HTTPS connection set up:
server {
listen 443;
server_name 127.0.0.1:8000;
...(other configurations including ssl_certificate,
ssl_certificate_key,protocols and cipher)
...(other values that I think its not relevant)
location / {
if ($http_host != 127.0.0.1:8000) {
return 444;
}
proxy_pass http://127.0.0.1:8000;
}然后我得到了:
server {
listen 80 default;
server_name ~^;
return 302 https://127.0.0.1:8000$request_uri;
}在我的漫游箱中,如果我使用curl获取127.0.0.1:8000:curl 127.0.0.1:8000的内容,我就能够成功获取预期的内容
在我的主机操作系统中,当我使用chrome请求访问127.0.0.1时,它只显示The connection was reset.,错误异常代码为ERR_CONNECTION_RESET
我最好的猜测是,这必须处理我的SSL配置?
发布于 2017-10-17 03:23:28
由于不确定这是否有帮助,我运行vagrant并使用Virtualbox作为我的虚拟机管理程序。您将需要检查流浪箱对NAT执行的操作。在我的机器上,开箱即用的是192.169.33.10,这将到达我的dev box。假设端口转发设置正确,并且没有防火墙。
192.168.33.10:8080做什么?
https://stackoverflow.com/questions/46777558
复制相似问题