用户工具

站点工具


web:websocket

recorderjs

audio+videoaudio-example

  • https2http.conf
server {
        listen 443 ssl http2;
        server_name api.xlongwei.com;
        access_log off;
        ssl_certificate /soft/cert/xlongwei.pem;
        ssl_certificate_key /soft/cert/xlongwei.key;
        ssl_session_cache shared:SSL:1m;
        ssl_session_timeout  5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;
        location / {
                if ( $request_method = OPTIONS ) {
                        add_header 'Access-Control-Allow-Origin' '*';
                        add_header 'Access-Control-Allow-Headers' '*';
                        add_header 'Access-Control-Allow-Methods' '*';
                        return 200;
                }
                proxy_pass http://127.0.0.1:80;
                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_set_header Host $host;
                proxy_set_header SSL '1';
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
                proxy_redirect http:// https://;
        }
}
  • proxy_pass
    location /ws/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_pass http://api;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
web/websocket.txt · 最后更改: 2020/12/18 13:41 由 admin