laravel echo服务器和net::err\u ssl\u协议\u https版本错误

w1e3prcc  于 2021-06-08  发布在  Redis
关注(0)|答案(1)|浏览(431)

我在nginx服务器上使用了laravel5.8,包括laravelecho服务器、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:* 但还是一样的问题。

dhxwm5r4

dhxwm5r41#

我终于解决了这个问题。
我补充说:
"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:* 它可能会在将来帮助别人。

相关问题