Реверберация Laravel не работает с SSL при работе с ApacheApache

Ответить
Anonymous
 Реверберация Laravel не работает с SSL при работе с Apache

Сообщение Anonymous »

Я использую Let's Encrypt SSL.
PHP 8.3.12 — Laravel 11.29.0
В терминале после запуска: php artisan reverb:start --debug
Это показывает: Запуск сервера на 0.0.0.0:8080 (example.com).
Получение этой ошибки в консоли блейда получения уведомлений. файл.
Изображение

Для справки: я с помощью aapanel.
Мой код события
class SendNotification implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public $msg;

public function __construct($msg)
{
//
$this->msg = $msg;

}

/**
* Get the channels the event should broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return new Channel('noti');
}

public function broadcastAs()
{
return "notify";
}

public function broadcastWith()
{
return [
"message" => $this->msg
];
}
}

.env файл
REVERB_APP_ID=APP_ID
REVERB_APP_KEY=APP_key
REVERB_APP_SECRET=APP_SECRET
REVERB_HOST="example.com"
REVERB_SERVER_PORT=8080
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}"

web.php
Route::get('receive-notification', function(){
return view('receive-notification');
});
Route::get('/send-notification/{msg}', function($msg){
echo "Notification Message=>".$msg;
event(new SendNotification($msg));
});

файл 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'],
});

код JavaScript receive-notification.blade.php
@vite('resources/js/app.js')

window.Echo.channel("noti").
listen(".notify", (e) => {
console.log(e);
} )


файл конфигурации виртуального хоста

ServerAdmin webmaster@example.com
DocumentRoot "/www/wwwroot/example.com/public"
ServerName ea68ca5f.example.com
ServerAlias example.com www.example.com
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/example.com-error_log"
CustomLog "/www/wwwlogs/example.com-access_log" combined
#HTTP_TO_HTTPS_START

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]

#HTTP_TO_HTTPS_END

#DENY FILES

Order allow,deny
Deny from all


#PHP

SetHandler "proxy:unix:/tmp/php-cgi-83.sock|fcgi://localhost"


#PATH

SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm




ServerAdmin webmaster@example.com
DocumentRoot "/www/wwwroot/example.com/public"
ServerName SSL.example.com
ServerAlias www.example.com example.com
#errorDocument 404 /404.html
ErrorLog "/www/wwwlogs/example.com-error_log"
CustomLog "/www/wwwlogs/example.com-access_log" combined

#SSL
SSLEngine On
SSLCertificateFile /www/server/panel/vhost/cert/example.com/fullchain.pem
SSLCertificateKeyFile /www/server/panel/vhost/cert/example.com/privkey.pem
SSLCipherSuite EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5
SSLProtocol All -SSLv2 -SSLv3 -TLSv1
SSLHonorCipherOrder On

#PHP

SetHandler "proxy:unix:/tmp/php-cgi-83.sock|fcgi://localhost"


#DENY FILES

Order allow,deny
Deny from all


#PATH

SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Require all granted
DirectoryIndex index.php index.html index.htm default.php default.html default.htm


ProxyPreserveHost On

ProxyPass ws://0.0.0.0:8080/app
ProxyPassReverse ws://0.0.0.0:8080/app


ProxyPass http://0.0.0.0:8080/apps
ProxyPassReverse http://0.0.0.0:8080/apps



Подробнее здесь: https://stackoverflow.com/questions/793 ... ith-apache
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Apache»