Merhaba
Laravel websockets paketi ile kendi socket sunucumu ayağa kaldırmaya çalışıyorum paket pusher paketini otomatik olarak kullanıyor.
Localde ayağa kaldırmama rağmen production da bir türlü bağlantı sağlayamadım
Hem socket hemde web için aynı konumu kullanmak istiyorum. Dökümantasyondaki çoğu şeyi denedim ama başarılı olamadım yardımcı olabilecek olan var mı ?
Dökümantasyon :
link
Nginx conf dosyam
upstream websockets {
server laravel-socket-server:6001;
}
map $http_upgrade $type {
default "web";
websocket "ws";
}
server {
listen 80;
listen [::]:80;
server_name nodejs.5deniz.com;
server_name_in_redirect off;
index index.php index.html;
root /var/www/html/laravel-socket-server/public;
location / {
try_files /nonexistent @$type;
}
location @web {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass laravel-socket-server:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location @ws {
proxy_pass http://websockets;
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;
}
}