本帖最后由 dgmax 于 2018-2-22 22:43 编辑
小白一枚,还是从论坛里找到了这个https://bbs.hassbian.com/forum.p ... =1686&highlight=ssl
说说经历吧:
方法1-HASS配置SSL,但homebridge连接不上SSL
方法2-docker 装nginx无法登录HASS
方法3-群晖自带的反向代理设置也是无法登录HASS
方法4-还是HASS配置SSL,homebridge配置中增加 "verify_ssl": false。就过了!
这次历时3天,花了3块钱开了腾讯和阿里的各一个域名,认识到了证书等相关知识。
多谢@Jones 的提点,让群晖也顺带一起SSL了,这一步本来是在HASS后做的,结果经Jones的指点先整了~~
如题安装了NGINX 在/etc/nginx/conf.d/default.conf 中设置如下代码:
# HTTPS
server {
listen 8122;
server_name [url=http://www.d123ax.top]www.d123ax.top[/url];
ssl on;
#root html;
#index index.html index.htm;
ssl_certificate /etc/nginx/conf.d/webssl/fullchain.pem;
ssl_certificate_key /etc/nginx/conf.d/webssl/privkey.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
proxy_pass [url=http://127.0.0.1:8123;]http://127.0.0.1:8123;[/url]
#Proxy Settings
proxy_redirect off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_max_temp_file_size 0;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
返回的日志信息
/etc/nginx/nginx.conf 配置信息如下(未修改)
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
手机APP与网页均无法登录,长期转圈,求大神帮忙看看代码哪个有问题了~
|