#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