Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Illuminate\Broadcasting\BroadcastException: Pusher error: 404 Not Found #1180

@fdjrr

Description

@fdjrr

Hello, I got error like this on jobs

Illuminate\Broadcasting\BroadcastException: Pusher error: <!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Not Found</title>
. in /var/www/whatsapp.deltamastoyota.com/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:164

How to fix it? Please help..

My .env file

PUSHER_APP_ID=websocket@localhost
PUSHER_APP_KEY=ROGMtRaCEpeR
PUSHER_APP_SECRET=ROGMtRaCEpeR
PUSHER_HOST=tld.com
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

My events file

public $contact_uuid, $broadcast;

  /**
   * Create a new event instance.
   */
  public function __construct($contact_uuid, Broadcast $broadcast)
  {
    $this->contact_uuid = $contact_uuid;
    $this->broadcast    = new BroadcastResource($broadcast);
  }

public function broadcastOn(): array
  {
    return [
      new PresenceChannel("broadcast.{$this->contact_uuid}"),
    ];
  }

Calling the event

broadcast(new sendMessage($contact->uuid, $broadcast));

Configuration nginx

map $http_upgrade $type {
  default "web";
  websocket "wss";
}

server {
    listen 80;
    server_name tld.com;

    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443;

    ssl_certificate /home/user/ssl/ssl-bundle.crt;
    ssl_certificate_key /home/user/ssl/tld.com.key;
    ssl_prefer_server_ciphers on;

    server_name tld.com;
    root /var/www/tld.com/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.php;

    charset utf-8;

location / {
    try_files /nonexistent @$type;
  }

    location @web {
        try_files $uri $uri/ /index.php?$query_string;
    }

  location @wss {
    proxy_pass             http://127.0.0.1:6001;
    proxy_set_header Host  $host;
    proxy_read_timeout     60;
    proxy_connect_timeout  60;
    proxy_redirect         off;

    # Allow the use of websockets
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

This happens if I set the websocket as https, if http everything runs normally... where is my error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions