兰秋十六

Nginx部署Laravel Reverb

read time 1 min read
技术 运维

Laravel Reverb

Laravel部署 Reverb实现广播消息通知和推送消息(Websocket)

plaintext
location / {
    try_files $uri $uri/ /index.php?$query_string;
    
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection Upgrade;
}

如提示变量$http_upgrade未定义,请在nginx配置文件中添加如下配置:

nginx
  #略...
http {
    map $http_upgrade $connection_upgrade {
           default upgrade;
           ''      close;
       }
       
       #略...
 }