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;
}
}
推荐文章: