【发布时间】:2018-03-28 09:39:14
【问题描述】:
我正在尝试在 centos/6 虚拟机上使用 Vagrant 设置本地 Web 测试环境
在我设置的vagrant配置中:config.vm.network "forwarded_port", guest: 80, host: 8080
如果我在 vagrant box 里面输入: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;
}
在我的vagrant box中,如果我使用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 配置?
【问题讨论】:
标签: linux ssl nginx vagrant webserver