WebSocket Nginx 426 Upgrade required

Questions : WebSocket Nginx 426 Upgrade required

708

I have a webchat (example.com/chat) programming listening on tcp://0.0.0.0:50500 on my Learning server. I've also configured nginx reverse Earhost proxy to send data from my example.com/chat most effective to 0.0.0.0:50500.

My site nginx conf goes like this:

map $http_upgrade $connection_upgrade {
 _OFFSET);   default Upgrade;
  ''      (-SMALL  close;
}
server {
    server_name _left).offset  example.com www.example.com  ;
    arrowImgView.mas  listen 5.4.....0:443 ssl  http2 ;

    (self.  listen [2a0......:a4]:443 ssl  http2 ;

 equalTo     ssl_certificate make.right.  "/var/www......._51.crt";
    mas_top);  ssl_certificate_key ImgView.  "/var/www/.......51.key";
    add_header ReadIndicator  Strict-Transport-Security _have  "max-age=31536000" always;

    charset .equalTo(  utf-8;
    gzip on;
    gzip_proxied make.top  expired no-cache no-store private auth;
 OFFSET);     gzip_types text/css text/xml (TINY_  application/javascript text/plain .offset  application/json image/svg+xml mas_right)  image/x-icon;
    gzip_comp_level 1;

   ImgView.   set $root_path Indicator  /var/www/user/data/www/example.com;
    Read  root $root_path;
    disable_symlinks _have  if_not_owner from=$root_path;

    .equalTo(  location / {

        proxy_pass make.left  http://127.0.0.1:81;
        *make) {  proxy_redirect http://127.0.0.1:81/ /;
  straintMaker        include /etc/nginx/proxy_params;
  ^(MASCon    }
    
    location ~ ^/chat {
        onstraints:  proxy_set_header Host $host;
        mas_makeC  proxy_set_header X-Forwarded-Proto [_topTxtlbl   $scheme;
        proxy_set_header (@(8));  X-Forwarded-Port $server_port;
        equalTo  proxy_set_header X-Forwarded-For  width.  $proxy_add_x_forwarded_for;
        make.height.  proxy_pass http://0.0.0.0:50500;
        (SMALL_OFFSET);  proxy_http_version 1.1;
        .offset  proxy_set_header Upgrade $http_upgrade;
 (self.contentView)         proxy_set_header Connection  .left.equalTo  $connection_upgrade;
        make.top  proxy_read_timeout 300s;
        *make) {  proxy_buffering off;
  }


     location ntMaker   ~* SConstrai  ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico|7z|doc|docx|map|ogg|otf|pdf|tff|tif|txt|wav|webp|woff|woff2|xls|xlsx|xml)$ ts:^(MA  {
        try_files $uri $uri/ Constrain  @fallback;
        expires 30d;

    }

 _make     location @fallback {
        iew mas  proxy_pass http://127.0.0.1:81;
        catorImgV  proxy_redirect http://127.0.0.1:81/ /;
  ReadIndi        include /etc/nginx/proxy_params;
   [_have    }

    include ($current);  "/etc/nginx/fastpanel2-sites/fastuser/example.com.includes";
 entity_loader     include _disable_  /etc/nginx/fastpanel2-includes/*.conf;
  libxml    error_log $options);  /var/www/user/data/logs/example.com-frontend.error.log;
 ilename,     access_log ->load($f  /var/www/user/data/logs/example.com-frontend.access.log;
}


server $domdocument  {
    server_name example.com loader(false);  www.example.com  ;
    listen _entity_  5.4.....0:80;
    listen  libxml_disable  [2a.....:a4]:80;

    return 301 $current =  https://$host$request_uri;

     10\\ 13.xls .  error_log File\\ 18\'  /var/www/user/data/logs/example.com-frontend.error.log;
 /Master\\ 645     access_log user@example.  /var/www/user/data/logs/example.com-frontend.access.log;
}

The webchat is configured to use these wrong idea settings:

SOCKET_CHAT_URL="wss://example.com"
SOCKET_CHAT_PORT=50500

Since I have an upgrade header, the 426 use of case Upgrade required error looks strange to United me. I know there are a lot of similar Modern threads related to this issue, however, they ecudated all suggest creating an upgrade header that some how I already have.

I've tried to:

  • Use both SOCKET_CHAT_URL="ws://example.com" and "wss://example.com"
  • Changing the proxy_pass line to https: https://0.0.0.0:50500; << in this case the /chat page goes nginx 504 timeout.
  • changing the WebSocket line to the server IP: wss://123.312.123.321
  • wss://example.com/chat format << in this case the page closes a websocket connection instantly

Also, my header:

General
Request URL: scp not2342  https://example.com/chat
Request Method:  13.xls  GET
Status Code: 426 
Remote Address: 18 10  5**.***.***.*50:443
Referrer Policy: File sdaf  strict-origin-when-cross-origin

Response /tmp/Master'  Headers
date: Mon, 06 Sep 2021 21:11:50 com:web  GMT
sec-websocket-version: 13
server: user@example.  nginx/1.18.0
strict-transport-security: scp var32  max-age=31536000
upgrade:  18 10 13.xls  websocket
x-powered-by: id12  File  Ratchet/0.4.3

Request web/tmp/Master  Headers
:authority: example.com
:method: example.com:  GET
:path: /chat
:scheme: https
accept: scp user@  text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: $val  gzip, deflate, br
accept-language: left hand  uk-UA,uk;q=0.9
cache-control: right side val  max-age=0
sec-ch-ua: "Chromium";v="94", data //commnets  "Google Chrome";v="94", ";Not A //coment  Brand";v="99"
sec-ch-ua-mobile: !node  ?0
sec-ch-ua-platform: $mytext  "Windows"
sec-fetch-dest: nlt means  document
sec-fetch-mode: umv val  navigate
sec-fetch-site: sort val  none
sec-fetch-user: shorthand  ?1
upgrade-insecure-requests: hotkey  1
user-agent: Mozilla/5.0 (Windows NT more update  10.0; Win64; x64) AppleWebKit/537.36 valueable  (KHTML, like Gecko) Chrome/94.0.4606.31 catch  Safari/537.36
Total Answers 1
32

Answers 1 : of WebSocket Nginx 426 Upgrade required

Okay, the server runs on HTTP/2, and anything else WebSockets are not supported on not at all it. Also, it is not possible to switch very usefull only 1 site to HTTP/1.1 with Nginx, you localhost should switch an entire server for that.

We've switched to sockets.io

0

Top rated topics

Error: node_modules/@angular/fire/compat/firestore/firestore.d.ts:92:22

Sql table data display change

Kick Script discord.js v.13

How to force browser to update cache files after a new Deploy

Stuck with hamburger menu

How to debug react native installed apk?

Git - recover from bad tree object?

Continuously listening to smart contract events

How can I order columns horizontally by columns called OnHandX in SQL Server?

UseState too many re-renders in initial load

Export awaited value as ESM module

Flutter/Dart setState are not refreshing the Text in Text Widget

Python - Read text and write into csv. Replace empty columns as a default 'N/A' value

Nginx not finding static files in Dockered Django app in Azure Web App for containers

Node js Mysql Innter join with multiple databases tables

Spring boot mongodb cloud cluster

Pd.read_csv ignore comma if it is inside parenthesis

Equivalent of std::iota in java

How to combine two YOLOv5 models?

Get he terminal to construct vocabulary with grammar (CFG)

Get text after first occurrence of a Character

Use output number of echo as input for seq

Blazor CascadingParameter won't update layout when I call it from a function, after an onclick event

Why django channels are not receiving headers?

Create a column with date time adding months

Calling select query after update query with flask-sqlalchemy db.engine.execute() returns un-updated resultset

Is it possible to generate dynamic variable names in Karate?

Send email to different email to verify registration using angular firebase

Extracting Attribute Values of a div in BeautifulSoup

Save a char* parameter intro a string

Getting error after entering flutter run - "Running Gradle task 'assembleDebug'..."

Why are those NavigationLinks not clickable?

I am trying to connect mongodb server with node

Skb_tail_pointer(skb) not work correctly. And point the udp header tail wrongly

How can i make archive iPA in Visual studio MAC. error occur in latest version

Null value is saving instead of entered value in Flutter

Connect QuickBooks with Foundry

Detect a star in Python

Add validation to CsvHelper.Configuration.ClassMap object (string)

What is the maximum allowance for group_concat_max_len in MySQL?

In kiss_fft, why does kf_bfly2 take an array as argument? The argument seems to be a scalar

Python datatable groupby and apply a custom function

Argument #1 ($haystack) must be of type string, Closure given on Laravel Eloquent

Customizing login page for OAUTH2 login with Spring Webflux

How to filter data according to the rule: if this value exists then filter for it, if not -&gt; filter for another one

Custom Docker for serverless lambda

I have an idea for blocking spam, I want to know if I can implement it

How to split string with specific condition in Javascipt

MongoDB - Update / Replace array field with subdocument to embed its content

How to Upload txt file using apache camel rest end point from HTML page

Top