Update BroadcastServiceProvider to include API versioning and enhanced middleware configuration. Revise Nginx configuration comments for clarity on broadcasting and websocket proxy setup.
This commit is contained in:
@@ -17,6 +17,11 @@ class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
Broadcast::routes(['middleware' => ['auth:sanctum']]);
|
||||
|
||||
Broadcast::routes([
|
||||
'prefix' => 'api/v1',
|
||||
'middleware' => ['api', 'api_token', 'auth:sanctum'],
|
||||
]);
|
||||
|
||||
Broadcast::routes([
|
||||
'prefix' => 'panel',
|
||||
'middleware' => ['web', NovaAuthenticate::class, NovaAuthorize::class, EnsureChatOperator::class],
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
# Laravel Reverb websocket proxy for mm.com.tm
|
||||
# Laravel Reverb + broadcasting auth for mm.com.tm
|
||||
#
|
||||
# Paste this location into the existing HTTPS server { } for mm.com.tm,
|
||||
# BEFORE any frontend SPA catch-all.
|
||||
# Paste into the existing HTTPS server { } for mm.com.tm.
|
||||
#
|
||||
# Reverb (supervisor) stays on 127.0.0.1:8080.
|
||||
# Browsers connect to wss://mm.com.tm/app/...
|
||||
# 1) Laravel PHP prefixes MUST include `broadcasting`, otherwise
|
||||
# POST /broadcasting/auth is caught by `location /` and proxied to
|
||||
# the SPA on :4173 (404). Keep this in the same regex as api/panel:
|
||||
#
|
||||
# location ~ ^/(api|storage|panel|vendor|nova-api|nova-vendor|sanctum|nova|app-docs|broadcasting) {
|
||||
# try_files $uri $uri/ /index.php?$query_string;
|
||||
# }
|
||||
#
|
||||
# 2) Reverb (supervisor) stays on 127.0.0.1:8080.
|
||||
# Browsers connect to wss://mm.com.tm/app/...
|
||||
# Place `location /app` BEFORE the SPA `location /` catch-all.
|
||||
|
||||
location /app {
|
||||
proxy_http_version 1.1;
|
||||
|
||||
Reference in New Issue
Block a user