I have settings like this in my nginx sites-available file, for a link that uses websocket :
location /messenger/chatrooms/ { try_files $uri @proxy_to_w