Nginx配置
upstream websocketserver {
server localhost:8080;
}
server {
server_name wss.website.test;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
access_log /app/vagrant/nginx/log/wss-access.log;
error_log /app/vagrant/nginx/log/wss-error.log;
location / {
proxy_pass http://websocketserver;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 86400; # neccessary to avoid websocket
proxy_redirect off;
}
}
有一个WS-server在端口8080上运行(它不使用任何TLS证书等)并基于Ratchet(http://socketo.me/)。
所以问题是真正的WSS或者这只是通常的而不是安全的WS与nginx语法糖的某些部分?