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:
1 parent
550ffea5c0
commit
57dd8ee378
2 files changed
+18
-5
No files matched your search
@@ -17,6 +17,11 @@ public function boot(): void
|
|||||||
{
|
{
|
||||||
Broadcast::routes(['middleware' => ['auth:sanctum']]);
|
Broadcast::routes(['middleware' => ['auth:sanctum']]);
|
||||||
|
|
||||||
|
Broadcast::routes([
|
||||||
|
'prefix' => 'api/v1',
|
||||||
|
'middleware' => ['api', 'api_token', 'auth:sanctum'],
|
||||||
|
]);
|
||||||
|
|
||||||
Broadcast::routes([
|
Broadcast::routes([
|
||||||
'prefix' => 'panel',
|
'prefix' => 'panel',
|
||||||
'middleware' => ['web', NovaAuthenticate::class, NovaAuthorize::class, EnsureChatOperator::class],
|
'middleware' => ['web', NovaAuthenticate::class, NovaAuthorize::class, EnsureChatOperator::class],
|
||||||
|
|||||||
+13
-5
@@ -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,
|
# Paste into the existing HTTPS server { } for mm.com.tm.
|
||||||
# BEFORE any frontend SPA catch-all.
|
|
||||||
#
|
#
|
||||||
# Reverb (supervisor) stays on 127.0.0.1:8080.
|
# 1) Laravel PHP prefixes MUST include `broadcasting`, otherwise
|
||||||
# Browsers connect to wss://mm.com.tm/app/...
|
# 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 {
|
location /app {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|||||||
Reference in new issue
Block a user