繁体   English   中英

https 版本上的 Laravel Echo Server 和 net::ERR_SSL_PROTOCOL_ERROR

[英]Laravel Echo Server and net::ERR_SSL_PROTOCOL_ERROR on https version

我在我的 nginx 服务器上使用 laravel 5.8 和 laravel echo 服务器、socket.io 和 redis。

我的网站一直工作到昨天没有错误,但今天它给了我套接字错误,例如:

GET https://example.com:6001/socket.io/?EIO=3&transport=polling&t=NHtNFvZ net::ERR_SSL_PROTOCOL_ERROR

这是我的 laravel-echo-server.json 文件:

{
    "authHost": "http://localhost:8000",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "123",
            "key": "123"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
            "port": "6379",
            "host": "127.0.0.1"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {},
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "http://localhost:80",
        "allowMethods": "GET, POST",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

首先我遇到了ERR_CRT_DATE_INVALID错误,但后来遇到了ERR_SSL_PROTOCOL_ERROR

我已经使用sudo supervisorctl restart echo-server:*重新启动了 echo worker,但仍然是同样的问题。

最后我解决了这个问题。

我补充说:

"authHost": "https://localhost:8000",

"protocol": "https",

"sslCertPath": "/etc/letsencrypt/live/example.com/fullchain.pem",

"sslKeyPath": "/etc/letsencrypt/live/example.com/privkey.pem",

在我的 laravel-echo-server.json 文件中并使用sudo supervisorctl restart echo-server:*重新启动 echo 服务器工作进程

将来可能会对某人有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM