As we know at this time nginx stable version can't proxy tcp connections. So if express and socket.io will work on the same port we need to use some other proxy solution.
But there are other ways to bypass this problem:
What advantages and disadvantages do these approaches have?
I prefer to use Haproxy in front and have only one public open port. The "rooting" is done per path.
The config looks like that (you can find easily many tutorials/resources)
frontend all 0.0.0.0:80
acl is_websocket path_beg /websocket/
use_backend nodejs if is_websocket
default_backend nginx
backend nodejs
server srv_node 127.0.0.1:16852
backend nginx
balance roundrobin
server srv_static 127.0.0.1:8080
You can do it with Varnish and Nginx - http://blog.dealspotapp.com/post/40923117591/websockets-with-varnish-and-multiple-nginx-backends
or with Haproxy - http://blog.dealspotapp.com/post/41226162147/websockets-with-haproxy-ssl-and-multiple-backends
If you use Haproxy, make sure to set the tunnel timeout to something long, such as 1 day. otherwise you'll see new sockets being created every few seconds.