我的thingsboard网站运行得很好。我用LetsEncript设置apache,并使用重定向规则将任何http活动传递给https。重定向起作用了,我可以登录到黑板上,但我的设备上没有任何遥测数据。如果我在本地通过http(而不是https)登录thingsboard,那么这些设备都有遥测功能。不确定为什么重定向会阻止站点访问数据库(如果这是问题所在)。
000-default.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>000-default-le-ssl.conf:
<VirtualHost *:443>
ServerName My_Domain.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/My_Domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/My_Domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>Thingsboard.log:
2019-02-01 01:19:54,577 [http-nio-0.0.0.0-8080-exec-3] ERROR o.s.w.s.s.s.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null
2019-02-01 01:19:58,567 [http-nio-0.0.0.0-8080-exec-1] ERROR o.s.w.s.s.s.DefaultHandshakeHandler - Handshake failed due to invalid Upgrade header: null
2019-02-01 01:20:00,773 [SockJS-2] INFO o.t.s.d.n.CassandraBufferedRateExecutor - Permits queueSize [0] totalAdded [0] totalLaunched [0] totalReleased [0] totalFailed [0] totalExpired [0] totalRejected [0] totalRateLimited [0] totalRateLimitedTenants [0] currBuffer [0] 不知道该怎么做。任何想法。
提前谢谢。
发布于 2019-02-02 01:23:25
我把它修好了。似乎是网络插座的问题。我在我的配置中添加了以下几行。
000-default-le-ssl.conf:
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://localhost:8080%{REQUEST_URI} [P]https://stackoverflow.com/questions/54471631
复制相似问题