HHVM 的 Nginx 配置 SSL 后 HTTP 不可用

HHVM 的 Nginx 配置 SSL 后 HTTP 不可用,但是 HTTPS 是正常的。

HTTP 访问后错误:
400 Bad Request
The plain HTTP request was sent to HTTPS port

HTTP 也无法通过

if ($scheme = http) {
    return 301 https://$server_name$request_uri;
}

强制跳转为 HTTPS,感觉开了 HTTPS,HTTP 就是废的。

请问怎么解决?

site-enable 里面的 default 配置文件 include 了的 hhvm.conf 内容如下

location ~ \.(hh|php)$ {
    fastcgi_keep_conn on;
    fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

default 配置文件如下

server {
listen 80;
listen 443 ssl;

root /usr/share/nginx/html;
index index.html index.htm index.php;

server_name wlppr.net;

ssl on;
ssl_certificate /etc/nginx/ssl/wlppr_net.crt;
ssl_certificate_key /etc/nginx/ssl/wlppr_net.key;

include hhvm.conf;

location / {

    try_files $uri $uri/ =404;

}

}
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 1
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!