Websocket(WSS)迁移连接问题-从apache到Nginx
我正在尝试将windows上的Apache websocket迁移到Ubuntu上的Nginx websocket 它可以在商业浏览器(Chrome、Firefox)上运行,但在移动应用程序上它报告了一个错误:Websocket(WSS)迁移连接问题-从apache到Nginx,apache,ubuntu,nginx,websocket,Apache,Ubuntu,Nginx,Websocket,我正在尝试将windows上的Apache websocket迁移到Ubuntu上的Nginx websocket 它可以在商业浏览器(Chrome、Firefox)上运行,但在移动应用程序上它报告了一个错误: 失败的websocket打开握手被取消 我搜索了很多错误,但我确信这是一个普遍的错误,而不是一个具体的错误 Nginx配置(适用于浏览器而非手机) Apache配置(在移动设备和浏览器上运行良好) 服务器管理员email@email.es DocumentRoot“c:/Apache/
失败的websocket打开握手被取消
我搜索了很多错误,但我确信这是一个普遍的错误,而不是一个具体的错误
Nginx配置(适用于浏览器而非手机)
Apache配置(在移动设备和浏览器上运行良好)
服务器管理员email@email.es
DocumentRoot“c:/Apache/htdocs”
ServerName ws.example.com
斯伦金安
SSLProtocol All-SSLv2-SSLv3
SSLCertificateFile“c:/Apache/Apache/conf/ssl/\uu cert\u com.crt”
SSLCertificateKeyFile“c:/Apache/Apache/conf/ssl/server.key”
SSLCertificateChainFile“c:/Apache/Apache/conf/ssl/\uu cert\u com.ca捆绑包”
标题集访问控制允许原点“*”
选项索引跟随符号链接多视图
允许超越所有
命令拒绝,允许
通融
要求所有授权
在Apache配置中,我添加了Header set Access Control Allow Origin“*”
我也在Nginx上尝试过,但没有成功
有什么建议吗?是否有文档中的
映射{}
?Nginx不应返回200。仅从手册中列出的代理标题开始。@Deadooshka我尝试了bro,但不起作用=(
server
{
listen 443 ssl;
server_name ws.example.com;
root /var/www;
ssl on;
ssl_verify_client off;
ssl_certificate /etc/nginx/ssl/cert.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_prefer_server_ciphers on;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers 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:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA;
access_log /var/log/wss-access-ssl1.log;
error_log /var/log/wss-error-ssl1.log;
location /websocket
{
access_log off;
proxy_pass http://localhost:1234;
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 timeout disconnect
proxy_redirect off;
satisfy any;
}
}
<VirtualHost *:443>
ServerAdmin email@email.es
DocumentRoot "c:/Apache/htdocs"
ServerName ws.example.com
SSLEngine on
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile "c:/Apache/apache/conf/ssl/__cert_com.crt"
SSLCertificateKeyFile "c:/Apache/apache/conf/ssl/server.key"
SSLCertificateChainFile "c:/Apache/apache/conf/ssl/__cert_com.ca-bundle"
Header set Access-Control-Allow-Origin "*"
<Directory "c:/Apache/htdocs">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Allow from all
Require all granted
</Directory>