Привет
Вот конфиг nginx'а:
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
map &http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080;
root /data/www;
location / {
}
location /images/ {
root /data;
}
location /ws/ {
proxy_pass http://localhost:8080/;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}
И с браузера (chromium) пытаюсь подключиться:
var ws = new WebSocket('ws://localhost:8080/ws/');
На что получаю:
WebSocket connection to 'ws://localhost:8080/ws/' failed: Error during WebSocket handshake: Unexpected response code: 200
Что я не так делаю?
nginx, websockets