Nginx配置Web Socket HTTPS WSS

来自linux中国网wiki
Evan讨论 | 贡献2019年12月20日 (五) 10:10的版本 →‎see also
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

nginx配置HTTPS WSS



cat  backend/wssns.cai.com.conf 
server {
    listen *:80;
	listen [::]:80;
    listen  *:443 ssl;
	listen [::]:443 ssl;
	
	server_name wssns.cai.com;
    access_log /var/log/nginx/wssns.cai.com.log;
    root /var/www/api.sns.cai.com/public;
    index index.php index.html index.htm;

#    ssl on;


    ssl_certificate /etc/nginx/ssl/cai.crt;
    ssl_certificate_key /etc/nginx/ssl/cai.key;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

    location / {
        proxy_pass http://172.16.200.10:9501;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
  }
}


see also

建立一个HTTPS的测试网络钱包

nginx配置HTTPS WSS