I wanted to setup nginx to serve both websockets (wss) and https on the same port — 443. The working solution is a little bit tricky, so I decided to write a short post for other pioneers.