首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Thingsboard apache https重定向丢失所有遥测数据

Thingsboard apache https重定向丢失所有遥测数据
EN

Stack Overflow用户
提问于 2019-02-01 09:22:04
回答 1查看 626关注 0票数 1

我的thingsboard网站运行得很好。我用LetsEncript设置apache,并使用重定向规则将任何http活动传递给https。重定向起作用了,我可以登录到黑板上,但我的设备上没有任何遥测数据。如果我在本地通过http(而不是https)登录thingsboard,那么这些设备都有遥测功能。不确定为什么重定向会阻止站点访问数据库(如果这是问题所在)。

000-default.conf:

代码语言:javascript
复制
<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:

代码语言:javascript
复制
<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:

代码语言:javascript
复制
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] 

不知道该怎么做。任何想法。

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2019-02-02 01:23:25

我把它修好了。似乎是网络插座的问题。我在我的配置中添加了以下几行。

000-default-le-ssl.conf:

代码语言:javascript
复制
    RewriteEngine on
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
    RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
    RewriteRule .* ws://localhost:8080%{REQUEST_URI} [P]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54471631

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档