Hi there, is Reverb running on the same host as Laravel?
I recently ran in the same error message because I followed an example from a blog post that caused the problem.
If you have Laravel and Reverb running at the same domain and on the same machine behind Nginx, I'd recommend this configuration adapted from Laravel's documentation:
# Laravel Reverb
## The Websocket Client/Laravel Echo would connect to /app
## The Laravel Backend would broadcast to /apps
location ~ ^/apps? {
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:6001;
}
Note the changes: since it's the same web server and domain that serves the Laravel app, this rules only takes over any URL that starts with /app or /apps (the ? in the regex matches zero or one s character).
The other change is proxy_pass to 127.0.0.1.
Then reload Nginx, restart Reverb, and try dispatching events.