TiboriusDev's avatar

Reverb does not start on production server

I have tried everything now, but I despair. But it won't run locally on the server.

I have a Linux server with plesk.

I'm having trouble knowing what to do with the ssl. I am using LetsEncrypt. Can I use that or do I have to use something else? How do I integrate it?

The whole thing is only used internally and not externally.

This is what my nginx looks like, which irritates me, in the tutorials it always says host $http_host, but in the file there is no such thing, it says host $host. Is the $http_host correct now or do I have to change it to $host?

Then here is my env

QUEUE_CONNECTION=sync
BROADCAST_CONNECTION=reverb
REVERB_APP_ID=?_id
REVERB_APP_KEY=?_key
REVERB_APP_SECRET=?_secret
REVERB_HOST="meinwarden.de"
REVERB_PORT=443
REVERB_SCHEME=https

VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

and I call that:

php artisan reverb:start --debug
INFO  Starting server on 0.0.0.0:8080 (meinwarden.de).

Error message is then just:

wss://meinwarden.de/app/{id}?protocol=7&client=js&version=8.4.0-rc2&flash=false' failed:

reverb conf:

'reverb' => [
            'host' => env('REVERB_SERVER_HOST', '0.0.0.0'),
            'port' => env('REVERB_SERVER_PORT', 8080),
            'hostname' => env('REVERB_HOST'),
            'options' => [
                'tls' => [],
            ],
            'max_request_size' => env('REVERB_MAX_REQUEST_SIZE', 10_000),
            'scaling' => [
                'enabled' => env('REVERB_SCALING_ENABLED', false),
                'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
                'server' => [
                    'url' => env('REDIS_URL'),
                    'host' => env('REDIS_HOST', '127.0.0.1'),
                    'port' => env('REDIS_PORT', '6379'),
                    'username' => env('REDIS_USERNAME'),
                    'password' => env('REDIS_PASSWORD'),
                    'database' => env('REDIS_DB', '0'),
                ],
            ],
            'pulse_ingest_interval' => env('REVERB_PULSE_INGEST_INTERVAL', 15),
            'telescope_ingest_interval' => env('REVERB_TELESCOPE_INGEST_INTERVAL', 15),
        ],

broadcasting config

'reverb' => [
            'driver' => 'reverb',
            'key' => env('REVERB_APP_KEY'),
            'secret' => env('REVERB_APP_SECRET'),
            'app_id' => env('REVERB_APP_ID'),
            'options' => [
                'host' => env('REVERB_HOST'),
                'port' => env('REVERB_PORT', 443),
                'scheme' => env('REVERB_SCHEME', 'https'),
                'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
            ],
            'client_options' => [
				// 'verify' => env('BROADCAST_VERIFY', true),
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
            ],
        ],

I have released ports

cat /proc/sys/net/ipv4/ip_local_port_range
# 32768    60999

echo.js

import Echo from 'laravel-echo';

import Pusher from 'pusher-js';
window.Pusher = Pusher;

window.Echo = new Echo({
    broadcaster: 'reverb',
    key: import.meta.env.VITE_REVERB_APP_KEY,
    wsHost: import.meta.env.VITE_REVERB_HOST,
    wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
    wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
    forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
    enabledTransports: ['ws', 'wss'],
});

I hope I have specified everything that is important. BR Tibor

0 likes
9 replies
JussiMannisto's avatar

Your SSL certificate and key settings point to the same file, which is wrong. Also the values aren't quoted correctly. I'd start by fixing those.

$http and $http_host are built-in variables in Nginx. Check the documentation for more information.

TiboriusDev's avatar
ssl_certificate            	"path to fullchain.pem"
ssl_certificate_key         "path to privkey.pem"
JussiMannisto's avatar

@TiboriusDev So does HTTPS work on your site? What do you see when you run sudo nginx -t?

What's going on here:

listen server_ip_v4:443 ssl;
listen [server_ip_v6]:443 ssl;

Have you hidden the IP addresses from your post, or is that what you have in your actual config file? Is there a reason why you're explicitly defining the IPs?

TiboriusDev's avatar

@JussiMannisto sudo nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

I have hidden the IP address in the post. It is written out in full in the file. The file was created by the system, I only added the one for /app.

How do I know if https works? If I call up the domain, then it is secure. But the domain is also on another server and connected to the server via dns.

An SSLCheck ( SSL Labs ) says everything is ok

TiboriusDev's avatar

@JussiMannisto

'apps' => [

        'provider' => 'config',

        'apps' => [
            [
                'key' => env('REVERB_APP_KEY'),
                'secret' => env('REVERB_APP_SECRET'),
                'app_id' => env('REVERB_APP_ID'),
                'options' => [
                    'host' => env('REVERB_HOST'),
                    'port' => env('REVERB_PORT', 443),
                    'scheme' => env('REVERB_SCHEME', 'https'),
                    'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
                ],
                'allowed_origins' => ['*'],
                'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),
                'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000),
            ],
        ],

    ],
TiboriusDev's avatar
TiboriusDev
OP
Best Answer
Level 1

Server reinstalled and everything implemented with Apache, then it worked.

Please or to participate in this conversation.