簡體   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