I have a website written on Laravel with Reverb for websockets. Everything works except websockets. They are sent from the browser to the server in the form wss://mydomain.com/app (which throw an error). Server listen on 0.0.0.0:8080 for them. For nginx this works with:
server { ... 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:8080; } ... }
But my server is on apache. How can I make incoming requests wss://mydomain.com/app being redirected on local address 0.0.0.0:8080 ?