arrow_left
Linkora Sync-Server
Introduction
Getting Started
Prerequisites
HTTPS Setup
Configuration
Config File & Env Vars
Database Setup
Deployment
Local JAR
Docker
Cloud Hosting
Advanced
Systemd Service
Nginx WebSocket Proxy
Firewall Setup
Security Notes
Troubleshooting
How It Works
Browser Extension
Nginx WebSocket Proxy Configuration
As you can see in the legendary lengthy conversation we had in
this issue
:
Problem
WebSocket connections fail with error:
Handshake exception, expected status code 101 but was 400
Solution
Add WebSocket headers to Nginx config:
location / {
proxy_pass http://localhost:45454;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
content_copy
Why It's Needed
WebSocket connections require HTTP upgrade headers to switch from HTTP to WebSocket protocol. Without these headers, the handshake fails and real-time sync doesn't work.
Your script should look similar to this:
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
listen 80;
server_name your-domain.com;

ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;

location / {
proxy_pass http://localhost:45454;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
content_copy
info
Last Updated on: Sep 11, 2025 at 04:00 PM IST
Made with genesis.