Question
Websocket 302 (redirect) error
http://prntscr.com/coliya -Chrome
http://prntscr.com/coljez -Opera
NGINX
server {
listen 0.0.0.0:80;
listen 0.0.0.0:443 ssl;
root /usr/share/nginx/html;
index index.html index.htm;
ssl on;
sslcertificate /etc/ssl/certs/ssl-bundle.crt;
sslcertificatekey /etc/ssl/private/budokai-onlinecom.key;
sslciphers ‘ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kED$
ssldhparam /etc/ssl/private/dhparmas.pem;
sslpreferserverciphers on;
sslprotocols TLSv1 TLSv1.1 TLSv1.2;
if ($sslprotocol = “”) {
rewrite ^ https://$host$requesturi? permanent;
}
largeclientheader_buffers 8 32k;
location / {
proxyhttpversion 1.1;
proxysetheader Accept-Encoding “”;
proxysetheader X-Real-IP $remoteaddr;
proxysetheader Host $host;
proxysetheader X-Forwarded-For $proxyaddxforwardedfor;
proxysetheader XFORWARDEDPROTO https;
proxysetheader X-NginX-Proxy true;
proxybuffers 8 32k;
proxybuffersize 64k;
proxysetheader Upgrade $httpupgrade;
proxysetheader Connection “Upgrade”;
proxyreadtimeout 86400;
proxypass http://budokai-online.com:8080 ;
}
The problem I’m having is that some computers and some browsers are being redirected when trying to get a connection to the websocket. When that 302 error shows up, the ’/*’ routes has been activated! This route redirects the user to the login page as you saw in the redirect response.The websocket upgrade request is turned into an ordinary http request somehow, somewhere! This seems to be where the problem is. What can be causing this?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×