Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are common issues when setting up Laravel Reverb on a production server
    Laravel Reverb production server setup Nginx configuration Laravel Echo WebSocket Reverb host and port Apache proxy module firewall settings scaling performance


What are common issues when setting up Laravel Reverb on a production server


here are the common issues when setting up Laravel Reverb on a production server:

1. Configuring Nginx Proxy Settings:
- You need to set up a subdomain (e.g., reverb.example.com) and configure Nginx to proxy requests from this subdomain to the Reverb server's IP and port. [1][2]
- Ensure that the Nginx configuration includes the necessary SSL/TLS settings to enable HTTPS for the Reverb WebSocket connections. [1]

2. Adjusting Laravel Echo Configuration:
- Update your Laravel Echo configuration to use the newly created subdomain and the default HTTP port 80. This ensures that Laravel Echo can communicate with your Reverb server through the designated subdomain. [1][2]

3. Specifying Reverb Host and Port in Laravel:
- In your Laravel application's configuration file (.env), specify the Reverb host as "localhost" and the Reverb port as 8080. [1][2]

4. Configuring Nginx for WebSocket Connections:
- Add a location block for the "/ws/" path in your Nginx configuration to handle WebSocket connections. Proxy these requests to the Reverb server running on 127.0.0.180. [1]

5. Enabling Proxy Module in Apache (if using Apache):
- Ensure that the proxy module is enabled in Apache. You may need to uncomment something in the httpd.conf file. [3]

6. Verifying Firewall and Port Settings:
- Check if the incoming port (e.g., 8080) used by the Reverb server is open and accessible. [2][3]

7. Ensuring Queue is Running (if using queues):
- If you're not broadcasting events from the server, make sure your queue is running or change the QUEUE_CONNECTION to sync. [2]

8. Handling Scaling and Performance:
- As the number of connections increases, there may be performance challenges due to the limitations of PHP compared to more specialized WebSocket servers like Soketi. [5]

By addressing these common issues, you should be able to successfully set up Laravel Reverb on a production server.

Citations:
[1] https://github.com/laravel/reverb/issues/107
[2] https://github.com/laravel/framework/discussions/50675
[3] https://stackoverflow.com/questions/tagged/laravel-reverb?tab=Votes
[4] https://stackoverflow.com/questions/78383337/solution-laravel-reverb-does-not-work-in-production-with-apache
[5] https://www.reddit.com/r/laravel/comments/1czbdrq/is_anyone_using_laravel_reverb/