人妻丰满熟妇AV无码片,岛国AV无码免费无禁网站,丰满岳乱妇一区二区三区,男插女高潮一区二区

nginx 同時反向代理 websocket 和 http

技術分享 2022-06-06 15:53:58
#PROXY-START/peerjs/

location ^~ /peerjs/
{
    proxy_pass https://0.peerjs.com/;
    proxy_set_header Host 0.peerjs.com;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    proxy_set_header Upgrade $http_upgrade;  
    proxy_set_header Connection "Upgrade"; 

    add_header X-Cache $upstream_cache_status;

    #Set Nginx Cache
    
    
    set $static_fileFYdmcVJi 0;
    if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
    {
    	set $static_fileFYdmcVJi 1;
    	expires 12h;
        }
    if ( $static_fileFYdmcVJi = 0 )
    {
    add_header Cache-Control no-cache;
    }
}

#PROXY-END/peerjs/

現(xiàn)在很多web應用一個地址,同時支持http和websocket的協(xié)議連接


這兩句主要websocket

proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade";
咨詢小瓶科技
咨詢我們
頂部