nginx配置了https后,怎么配置wss呢?
以下是我的https配置
upstream tomcat {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 443;
server_name www.xxxx.cn; # 你的域名
ssl on;
ssl_certificate cert/xxx.cn.pem; # 改成你的证书的名字
ssl_certificate_key cert/xxxx.cn.key; # 你的证书的名字
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
# note, there is not SSL here! plain HTTP is used
proxy_pass http://tomcat;
}
相似问题