79399021

Date: 2025-01-30 06:47:08
Score: 5.5
Natty:
Report link

I have similar problem and I found workaround. So my laravel project (inertia with react and typescript) is hosted on Hostinger VPS server on main domain "maindomain.com". reverb is working fine on this server. config for this are:

.env of maindomain.com

BROADCAST_CONNECTION=reverb
REVERB_APP_ID=your.reverb.app.id
REVERB_APP_KEY=your.reverb.app.key
REVERB_APP_SECRET=your.reverb.app.secret
REVERB_HOST=your.main.server.host # for Hostinger something like abc123456.hstgr.cloud
REVERB_PORT=8081
REVERB_SERVER_PORT=8082
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}"

Hostinger VPS CloudPanel's vshost (nginx), new server block at the last:

server {
  listen 8081 ssl;
  listen [::]:8081 ssl;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name abc123456.hstgr.cloud maindomain.com;
  
  location / {
        proxy_http_version 1.1;
        proxy_set_header Host $http_host;
        proxy_set_header Scheme $scheme;
        proxy_set_header SERVER_PORT $server_port;
        proxy_set_header REMOTE_ADDR $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
 
        proxy_pass http://0.0.0.0:8082;
    }
  }

now for the subdomain: .env:

REVERB_APP_ID=your.reverb.app.id
REVERB_APP_KEY=your.reverb.app.key
REVERB_APP_SECRET=your.reverb.app.secret
REVERB_HOST=your.main.server.host # SAME AS IN maindomain.com .env
REVERB_PORT=8083
REVERB_SERVER_PORT=8084
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}"

now as we added config server into main domain's project's vhost for maindomain.com add another for sub.maindomain.com:

server {
  listen 8083 ssl;
  listen [::]:8083 ssl;
  {{ssl_certificate_key}}
  {{ssl_certificate}}
  server_name abc123456.hstgr.cloud maindomain.com;
  
  location / {
        proxy_http_version 1.1;
        proxy_set_header Host $http_host;
        proxy_set_header Scheme $scheme;
        proxy_set_header SERVER_PORT $server_port;
        proxy_set_header REMOTE_ADDR $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
 
        proxy_pass http://0.0.0.0:8084;
    }
  }

after this:

this is working for me. hope its help others. if you find other solution please post so it helps other.

Reasons:
  • Blacklisted phrase (1): I have similar
  • RegEx Blacklisted phrase (2.5): please post
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): I have similar problem
  • Low reputation (1):
Posted by: Nirav Swami